Insert, update & delete a record in Entity Framework Core

Published: 04 February 2024
on channel: Round The Code
2,697
26

Learn how use CRUD to insert, update and delete an entity from a database using Entity Framework.

This tutorial will focus on using a DbContext to modify and change data through endpoints created in an ASP.NET Core Web API using C#.

We'll run the endpoints and show you the SQL Server database table records to verify that the CRUD operation has been a success.

We'll also show how you can use EF Core to validate and ensure that a record can only be updated or deleted if it exists.

► This is part 3 of our Get started with EF Core course. View the full playlist:
   • Get started with EF Core - Full course  

💻 Download the code example💻
https://www.roundthecode.com/dotnet-c...

📖 Learn .NET and C# with our online courses 📖
https://www.roundthecode.com/dotnet-c...

👨‍💻Take our .NET and C# coding challenges👨‍💻
https://www.roundthecode.com/dotnet-c...

► Chapters
0:00 What we'll cover
0:12 Create an insert, update model
0:51 Create a service to insert an entity
3:31 Create a Web API controller to insert an entity
5:32 Insert an entity through a Web API endpoint
6:05 Modify the service to update an entity
7:33 Modify the Web API controller to update an entity
8:32 Update an entity through a Web API endpoint
9:44 Add a Remove record to the DbContext interface
10:06 Modify the service to delete an entity
11:00 Modify the Web API controller to delete an entity
11:39 Delete an entity through a Web API endpoint
11:57 Learn more about EF Core

#efcore #entityframework #entityframeworkcore


Watch video Insert, update & delete a record in Entity Framework Core online without registration, duration hours minute second in high quality. This video was added by user Round The Code 04 February 2024, don't forget to share it with your friends and acquaintances, it has been viewed on our site 2,697 once and liked it 26 people.