.NET 10 Web API using Minimal APIs, EF Core and SQL Server
Learn how to build a .NET 10 Web API using Minimal APIs, Entity Framework Core and SQL Server with this tutorial, or watch the video:
Download the code example
You'll need to fill out the code example form. We will send you an email where you can download the code example.
Software
This is the software that will need to be installed onto your machine.
Visual Studio 2026. Version 18.0.0 or above. It will work with the free community version.
.NET 10 SDK. Version 10.0.0 or above.
Import the database
This application integrates with a SQL Server database. Inside the Database folder, there is MyShop.bacpac and MyShop.bak. Use either of these database backups to import the database to your local SQL Server database server.
The application
Inside Api/appsettings.Development.json, find ConnectionStrings.MyShopDbContext and point the connection string to your imported database.
Open up MyShop.slnx, and run the application. The Swagger documentation will load at https://localhost:7021/swagger with these endpoints:
/api/products (POST)- Creates a product/api/products/{id} (GET)- Gets a product/api/products/{id} (PUT)- Updates a product/api/products/{id} (DELETE)- Deletes a product
Download this code example
Enter your email and we'll send you a download link.
Related code examples
Learn how to add Entity Framework Core migrations in an Web API and worker project and use it to automate SQL scripts across all environments.
A .NET 8 xUnit project which uses the TimeProvider and FakeTimeProvider class to mock time and a timer in unit tests.
Download this code example
Enter your email and we'll send you a download link.