Skip to content
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

Startup configuration invalid on the page Sample: Build web APIs with OData support using ASP.NET Core #261

Open
tubenator opened this issue Aug 24, 2022 · 1 comment

Comments

@tubenator
Copy link

On the page https://docs.microsoft.com/en-us/odata/webapi/first-odata-api (md file: https://github.com/MicrosoftDocs/OData-docs/blob/main/Odata-docs/webapi/first-odata-api.md), The section titled Register OData has these lines of code:

    // requires using Microsoft.AspNet.OData.Extensions;
    services.AddOData();

The using statement looks like it should be Microsoft.AspNetCore.OData.Extensions instead, and there is no extension method for IServiceCollection called AddOData().

I'm running a newly-created .NET 6 web API following the Todo example linked in the doc page, and I installed Microsoft.AspNetCore.OData version 8.0.11.

@anstein-msft
Copy link

The code for at least .NET 6 should read something like:

services.AddControllers().AddOData()

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

No branches or pull requests

2 participants