You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A Blazor WASM project using an OData provider does not work correctly with Enum data, namely setting the OData filter as enumValue='1'. After changing the selector type from int to string, the OData filter changed to enumValue='Red' and everything worked perfectly. No testing was done for ServerSide.
Changed files:
Extensions.cs
public static IEnumerable<object> EnumAsKeyValuePair(Type enumType)
{
return Enum.GetValues(enumType).Cast<Enum>().Distinct().Select(val => new { Value = **val.ToString()**, Text = val.GetDisplayDescription() });
}
QueryableExtensions.cs
else if (PropertyAccess.IsEnum(column.FilterPropertyType) || PropertyAccess.IsNullableEnum(column.FilterPropertyType))
{
if (v != null)
{
value = **v.ToString()**;
}
if (sv != null)
{
secondValue = **sv.ToString()**;
}
}
I fixed the enum issue for OData query and tested for a real project. These changes do not change the default logic. After these changes, work fine with OData EDM by default after set EnumKeyAsSymbols = true. Small changes to files (Extensions, QueryableExtension) are required. My last Commit is in fork.
A Blazor WASM project using an OData provider does not work correctly with Enum data, namely setting the OData filter as enumValue='1'. After changing the selector type from int to string, the OData filter changed to enumValue='Red' and everything worked perfectly. No testing was done for ServerSide.
Changed files:
Fork
The text was updated successfully, but these errors were encountered: