OData / OData/AspNetCoreOData

Routing with OData Using Areas

Open
#77 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

followup
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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.