-
Notifications
You must be signed in to change notification settings - Fork 474
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
3.1 nightly with Endpoint Routing: How to MapODataRoute with services? IPerRouteContainer missing #2050
Comments
@NetTecture Would you please share your repo? |
@xuzhg I do not really have a repo - this is out of the migration of an existing project. ConfigureServices:
Configure:
I am quite sure I simply have forgotten something, but the error message is not helpfull and given that I work on the level of nightly builds - documentation is kind of not up to date ;) |
Just as update - if I replace the MapODataRoute with...
then it works, but obviously does not use my deserializer. But instead of the exception, I am getting the $metadata document. |
@NetTecture I see. Let me take a look and i will update you later. |
Thanks. Let me add the info I also get during debugging.
System.InvalidOperationException I have only stripped the last element with the line number in the startup file. |
@xuzhg Some more info: There something is really wrong. The following code
results in: System.InvalidOperationException This is actually the next issue - no idea where to put EnableDependencyInjection. I Tried before and after MapOdataRoute. Note that I have UseOData up in ConfigureServices and it is called, but somehow THAT IPerRouteContainer seems to be ignored when the time comes for MapOdataRoute. |
@NetTecture I see. Two places are wrong configured in
If you change it as:
It should work. Noted:
Please let me know any other problems. |
@NetTecture Are you ok for the investigation? Can I close this issue? |
@xuzhg Yeah, I actually close it. Some documentation update would definitely not be rejected for other people. THANKS a lot. |
@ClementeGao - did you figure this out? I'm wondering the same thing |
@ClementeGao Same issue for me as well. Did you figure this out? |
This is based on the current nightly.
I am stuck with this error.
Code:
As you can see, I have to use a little more complex setup because I am putting in my own deserializer for handing some specific reference syntax (odata bind).
I am stuck with an error and no idea how to fix this one. Executing this gets me:
System.InvalidOperationException: 'No service for type 'Microsoft.AspNet.OData.IPerRouteContainer' has been registered.'
Where do I find that one and how do I register it? A look into the builder and the services extensions gave me no sensible methods.
As info: I do have AddOData up in the services configuration. I also played around with EnableDependencyInjection before and after the MapODataRoute call and have no luck. Stuck here - and I need this overload because of the customized deserializer.
The text was updated successfully, but these errors were encountered: