DapperLib / DapperLib/Dapper.Contrib
cannot handle numeric identities when they > max integer value
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 293
- Forks
- 109
- PR merge metrics
- No merged PRs in 30d
Description
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
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in SqlMapperExtensions.cs at line 884, following the SqlCeServerAdapter.Insert stack trace and the cast of the returned identity value to int. Reproduce an insert whose numeric identity exceeds the Int32 maximum and verify that insertion and identity handling complete without the reported OverflowException.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100