Skip to content

Routing with OData Using Areas #77

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

Open
wjvii opened this issue Jan 24, 2021 · 2 comments
Open

Routing with OData Using Areas #77

wjvii opened this issue Jan 24, 2021 · 2 comments
Labels

Comments

@wjvii
Copy link

wjvii commented Jan 24, 2021

We have a number of existing controllers with the same names as our OData controllers and we would like to keep it that way since we use /api/controller for the current routing and want to use odata/controller for new odata enabled controllers. I have reviewed some of the odata and routing documents and in particular https://devblogs.microsoft.com/odata/routing-in-asp-net-core-8-0-preview/ since it applies to version 8 which I am using. I was thinking that the easiest way would be to use Areas so that my controllers could be of the same name but I could not come up with a configuration via maproute or attributes that worked and always ended up with an error "Attribute routes with the same name 'odata/controller' must have the same template" it would then list "api/controller/odata/controller" and "odata/controller" as the two with problem. If I rename the controller, it works but I would like to leave them the same for backward compatibility. Are Areas supported by OData routing? Is there another way to achieve what I am trying to do, same controller names, different routes?

Thank you in advance.

@ra-design
Copy link

Hi, I was having the same issue - [ODataModelAttribute] is the way to go in this case. Please take a look at #37 , in particular #37 (comment)

@KenitoInc
Copy link
Contributor

@wjvii Was your issue resolved?

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

No branches or pull requests

4 participants