Skip to content
New issue

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

Replace ODataUriResolver for non-edm model #422

Open
kakone opened this issue Jan 7, 2022 · 3 comments · May be fixed by #439
Open

Replace ODataUriResolver for non-edm model #422

kakone opened this issue Jan 7, 2022 · 3 comments · May be fixed by #439
Assignees
Labels

Comments

@kakone
Copy link

kakone commented Jan 7, 2022

In v7, for non-edm model, we could replace the default ODataUriResolver by adding our service in the configureAction of the EnableDependencyInjection method.

In v8, I didn't find a way to do this. For edm model, there is the configureServices parameter in the AddRouteComponents method, but I didn't find an equivalent for non-edm model.

@kakone
Copy link
Author

kakone commented Jan 7, 2022

I succeeded with an horrible workaround : I use a resource filter to set the Services in HttpContext.ODataFeature() (cf AspNetCoreODataDependencyInjection).

@gathogojr
Copy link
Contributor

Thanks @kakone for reporting the issue. In v8 you don't need the ODataUriResolver for routing. What behaviour are you expecting? Does your workaround provide that behaviour? Can you share a PR for us to review?

@kakone
Copy link
Author

kakone commented Jan 12, 2022

I need the StringAsEnumResolver because I want to be able to do an OData filter like Summary eq '0' instead of Summary eq 'Freezing'. So, I would like to replace the default ODataUriResolver.
I did a sample here. It works well with my custom StringAsEnumResolverFilterAttribute.
I'm going to try to do a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants