Welcome to the Blazor feedback portal. We’re happy you’re here! If you have feedback on how to improve the Blazor, we’d love to hear it!>
Thanks for joining our community and helping improve Syncfusion products!
Using Blazor WebAssembly, SfGrid, ODataV4Adaptor.
If saving data with enum property to odata v4 datasource (PATCH) a json conversion error is raised when parsing the http result data. It looks like System.Text.Json is not using the StringToEnumConverter().
Json data returned from odata PATCH (The enum property is named "Category"):
{"Name":"Inkopen","Number":"10000","Comment":null,"Category":"Purchase","AdministrationId":"a7f06e7c-b355-4c0b-83eb-82fa1cc1bb8c","TradingNameId":null,"Id":"67448dc5-c7eb-4bbd-82c9-b64c73ede85e","RowVersion":266001}
Error return in GridEvents OnActionFailure:
The JSON value could not be converted to Accounting.Api.LedgerCategoryType. Path: $.value[0].Category | LineNumber: 0 | BytePositionInLine: 170. at System.Text.Json.ThrowHelper.ThrowJsonException(String message) at System.Text.Json.Serialization.Converters.EnumConverter`1[[Accounting.Api.LedgerCategoryType, Accounting.Api, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].Read(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options) at...
Enum type definition:
public enum LedgerCategoryType
{Generic = 0,
Sales = 1,
Purchase = 2,
Taxes = 3,
Contra = 4,
Balance = 5
}