magiccodingman / Magic.IndexedDb

Use IndexedDb in Blazor like LINQ!
MIT License
27 stars 8 forks source link

Invalid cast from System.Decimal to 'System.Nullable` #8

Closed mavramos closed 3 days ago

mavramos commented 7 months ago

When data is retrieved and a parameter is null, the following error occurs: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100] Unhandled exception rendering component: Invalid cast from 'System.Decimal' to 'System.Nullable`1[[System.Int32, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]'.

Example: [MagicTable("Test", DbNames.Data)] public class TestDTO { [MagicPrimaryKey("IdTest")] public int IdTest { get; set; }

 public int? Age { get; set; }

}

If Age is null it gives that message

kortgat commented 5 months ago

@mavramos I did a pull request that fixes the nullable properties.

10