Learn Minimal APIs from start to finish. Perfect for beginners.

.NET 10 Web API using Minimal APIs, EF Core and SQL Server

David Grace David Grace

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.

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.

Download this code example

Enter your email and we'll send you a download link.