dotnet-spanner-entity-framework icon indicating copy to clipboard operation
dotnet-spanner-entity-framework copied to clipboard

Save update in a Decimal property - cast error to SpannerNumeric

Open alwydl opened this issue 1 year ago • 0 comments

Environment details

  • Programming language: C# netcore 6
  • OS: win10
  • Language runtime version: netcore6
  • Package version: 2.1.3

Steps to reproduce

  1. Using EF create a class with a property decimal
  2. update-database
  3. create 1 record
  4. recover the value of that record and update any other property
  5. await context.SavechangesAsync()

exception message: Unable to cast object of type 'System.Decimal' to type 'Google.Cloud.Spanner.V1.SpannerNumeric'.

####Error stacktrace at Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer`1.Equals(Object left, Object right) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.ChangeDetector.DetectValueChange(InternalEntityEntry entry, IProperty property) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.ChangeDetector.LocalDetectChanges(InternalEntityEntry entry) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.ChangeDetector.DetectChanges(IStateManager stateManager) at Microsoft.EntityFrameworkCore.DbContext.<SaveChangesAsync>d__60.MoveNext() at Inpro_Models.Repositories.EcommerceOrderREP.<UpdateStatus>d__1.MoveNext() in D:\Codes\InovarPro\WebServices\Inpro WebServices\Inpro_Models\Repositories\EcommerceOrderREP.cs:line 41

alwydl avatar Dec 15 '23 12:12 alwydl