.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
Download C# 13 code examples which includes all the new features so you can try them out for yourself and see what has changed from previous C# versions.
Download a .NET 10 sample project demonstrating Global Query Filters in Entity Framework Core, including soft delete and multitenancy, and run it in Visual Studio to see how they work in practice.
Download this code example
Enter your email and we'll send you a download link.