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
Assemblies affected
Which assemblies and versions are known to be affected e.g. ASP.NET Core OData 8.x
Describe the bug
A clear and concise description of what the bug is.
Reproduce steps
If we have
publicenumUserType{...}
But this enum is not defined in OData model.
Suppose we use this C# enum to assign a value for a untyped property or dynamic property, the result is empty resource.
Personp=new Person
{Data= UserType.Admin // System.Object Data {get;set;}}
We get:
"Data": {},
This is because, in "CreateUntypedPropertyValue", we can't get the Edm type for "UserType", then we consider it a resource.
So, goes to the resource serializer, owing that the enum type doesn't have public properties,
so, the final result is an empty resource.
Before the fix, the workaround is to call 'ToString'.
Personp=new Person
{Data= UserType.Admin.ToString()}
Data Model
Please share your Data model, for example, your C# class.
EDM (CSDL) Model
Please share your Edm model, for example, CSDL file.
You can send $metadata to get a CSDL XML content.
Request/Response
Please share your request Uri, head or the request body
Please share your response head, body.
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Please share your call stack or any error message
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
Assemblies affected
Which assemblies and versions are known to be affected e.g. ASP.NET Core OData 8.x
Describe the bug
A clear and concise description of what the bug is.
Reproduce steps
If we have
But this enum is not defined in OData model.
Suppose we use this C# enum to assign a value for a untyped property or dynamic property, the result is empty resource.
We get:
"Data": {},
This is because, in "CreateUntypedPropertyValue", we can't get the Edm type for "UserType", then we consider it a resource.
So, goes to the resource serializer, owing that the enum type doesn't have public properties,
so, the final result is an empty resource.
Before the fix, the workaround is to call 'ToString'.
Data Model
Please share your Data model, for example, your C# class.
EDM (CSDL) Model
Please share your Edm model, for example, CSDL file.
You can send
$metadata
to get a CSDL XML content.Request/Response
Please share your request Uri, head or the request body
Please share your response head, body.
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Please share your call stack or any error message
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: