DEV Community

sameer8saini
sameer8saini

Posted on

.NET Web API - CRUD Operations 🚀

Subscribe to Sameer Saini Youtube channel

Do you want to learn how to create REST APIs with ASP.NET Core?

In the above video tutorial, we will create a .NET 6 Web API from scratch step by step.

We will use the latest version of ASP.NET i.e. .NET 6 and will use Visual Studio to create our Web API.

We will start by installing an In-Memory database package that is offered to us by Entity Framework.

We can use this database to perform CRUD operations on this REST API.

CRUD stands for Create, Read, Update and Delete.

We will create our domain models and then create a DBContext.

We will then inject this DbContext in the services of this web API application.

We will also create a new controller in our solution which acts as an API endpoint.

In this API endpoint, we will build controller methods like GET, POST, PUT and DELETE to perform CRUD operations on our In-Memory database.

Once this is all done and working, we will install EF Core packages from nuget to run migrations using Entity framework core and create a SQL Server database.

Then we will modify the service injection slightly to now use SQL Server instead of the In-Memory database.

I hope you like the video.

Please show your support by hitting that like button 👍 and subscribing to the channel.

Top comments (1)

Collapse
 
hidenmoons profile image
hidenmoons

hi , how i can run pm in vs code ?