Routing with OData Using Areas
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 505
- Forks
- 186
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked ASP.NET Core 8 OData routing article and review the MapRoute and attribute-routing approaches described in the issue. Determine whether Areas can support identical controller names with separate api/controller and odata/controller routes, and document either a working configuration or the confirmed limitation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- api, backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100