We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello,
thank you for this great writeup on dev.to.
Could you maybe extend the sample of how to use it with enums?
I have a client which I cannot change which makes request like $filter=Type+eq+'0' where '0' is the int representation of the enum.
Is this possible?
The text was updated successfully, but these errors were encountered:
I have a client which I cannot change which makes request like $filter=Type+eq+'0' where '0' is the int representation of the enum. Is this possible?
I think currently OData supports filtering by the "string" representation. Example: https://localhost:8001/v1/Notes?$filter=Type eq 'Public'
https://localhost:8001/v1/Notes?$filter=Type eq 'Public'
My enum:
public enum NotesType { Public, Private }
Maybe, do you mean this enum?
https://devblogs.microsoft.com/odata/tutorial-sample-use-enumeration-types-in-odata/
I think this issue will answer your doubt.
Sorry, something went wrong.
Thank you for the quick response.
Unfortunately, it is not possible to change our client-applications to use the "string"-representation of the enum.
The last link you mentioned contains a NuGet package which unfortunately is not open source and throws an exception with dotnet 6.
I have read about the StringAsEnumResolver, but I don't get it to work correctly as I don't fully understand how to inject it into the OData services without using a edm model. (For that there is actually a pending pull request, which is not merged yet)
Maybe you have an idea?
No branches or pull requests
Hello,
thank you for this great writeup on dev.to.
Could you maybe extend the sample of how to use it with enums?
I have a client which I cannot change which makes request like $filter=Type+eq+'0'
where '0' is the int representation of the enum.
Is this possible?
The text was updated successfully, but these errors were encountered: