Building a web service that supports OData
There is no dotnet
new
project template for ASP.NET Core OData, but it uses controller classes, so we will use the ASP.NET Core Web API project template and then add package references to add the OData capabilities:
- Use your preferred code editor to add a new project, as defined in the following list:
- Project template: ASP.NET Core Web API/
webapi
- Workspace/solution file and folder:
Chapter10
- Project file and folder:
Northwind.OData.Service
- Other Visual Studio options: Authentication Type: None, Configure for HTTPS: Selected, Enable Docker: Cleared, Use controllers (uncheck to use minimal APIs): Checked, Enable OpenAPI support: Selected, Do not use top-level statements: Cleared.
In Visual Studio Code, select
Northwind.OData.Service
as the active OmniSharp project. - Project template: ASP.NET Core Web API/
- Configure the project to treat warnings as errors and add a package reference for ASP.NET...