.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
See a code example of how transactions are used in Entity Framework Core and how they can be committed and rolled back
An ASP.NET Core Web API code example which includes the new data annotations for .NET 8 such as AllowedValues and Length.
Download this code example
Enter your email and we'll send you a download link.