Dapper.Contrib icon indicating copy to clipboard operation
Dapper.Contrib copied to clipboard

cannot handle numeric identities when they > max integer value

Open chengen1213 opened this issue 4 years ago • 1 comments

System.OverflowException: Value was either too large or too small for an Int32. at System.Decimal.ToInt32(Decimal d) at System.Decimal.op_Explicit(Decimal value) at SqlCeServerAdapter.Insert(IDbConnection connection, IDbTransaction transaction, Nullable1 commandTimeout, String tableName, String columnList, String parameterList, IEnumerable1 keyProperties, Object entityToInsert) in //Dapper.Contrib/SqlMapperExtensions.cs:line 884 at Dapper.Contrib.Extensions.SqlMapperExtensions.Insert[T](IDbConnection connection, T entityToInsert, IDbTransaction transaction, Nullable`1 commandTimeout) in //Dapper.Contrib/SqlMapperExtensions.cs:line 377

var id = (int)r[0].id;

in \SqlMapperExtensions.cs

line 884 - cannot handle numeric identities when they > max integer value

chengen1213 avatar Oct 07 '21 06:10 chengen1213

This has been known since 2016 and is being considered since 2017 for version 3. Value was either too large or too small for an Int32.

So it is probably not going to be solved soon. I'm currently looking for a work-around myself.

emilsteen avatar Apr 28 '22 10:04 emilsteen