Kros-sk / Kros.Libs

This repo contains Kros.Utils, Kros.Utils.MsAccess, Kros.KORM and Kros.KORM.MsAccess libraries.
MIT License
7 stars 13 forks source link

Inserting data with DbSet fails on some column types #143

Closed satano closed 6 years ago

satano commented 6 years ago

Breaking changes

ColumnSchema class had method SetParameterDbType, which set a data type for DbCommand parameter. This method was renamed to SetupParameter, because it is doing more than just setting data type. It should set Size, Precision and Scale as well.

Library name and version

Description

Inserting data with DbSet fails when table has some specific columns.

Exception is thrown when IDbCommand.Prepare() is called. In both cases, the problem is, that command parameters does not have set every needed values: Size for text column and Precision and Scale for numeric column.

We do not support Precision and Scale in our database schema yet, so to fix this issue, we must support them.

Steps To Reproduce

  1. Have a table with column with affected data type.
  2. Add some data to the DbSet.
  3. Commit data (DbSet.CommitChanges()).

Expected behavior

Inserting data should just work.

Actual behavior

Exception is thrown.