Skip to content

How to add URL path version to ODataController using attribute routing in OData 8.x #1095

Discussion options

You must be logged in to vote

Navigating the mess that is OData routing conventions is daunting. I empathize.

Observations

  1. You shouldn't have to call UseRouting() as that is done for you (it worked for me without it)
  2. Naming with OData is everything. I'm 99% sure an entity and entity set cannot have the same name
    a. This means you should have WeatherForecasts and WeatherForecast
  3. OData is intrinsically not version-aware and, therefore, makes many assumptions in its naming conventions
    a. There can only be one Get in code, which is enforced by the compiler
    b. GetV2 will never be seen or treated as matching Get without some help

Honestly, I don't think I have a lot of examples of version interleaving with OData. This is …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by bedding
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants