5 CRUD operations
This chapter covers
- Performing SELECT, INSERT, UPDATE, and DELETE queries with Entity Framework Core
- Handling different requests using HTTP GET, POST, PUT and DELETE methods
- Introducing Data validation concepts
- Implementing some Server-Side Validation techniques
In the previous chapter we have dedicated ourselves to the installation, set up and configuration of all the prerequisites necessary to interact with a DBMS, as well as learning the means, techniques, and reasons to do that.
Now that we have a Database context and an Object-Relational Mapper (ORM) up and running, we are ready to perform the typical data-related tasks: Create, Read, Update, and Delete (CRUD), which will be respectively handled by INSERT, SELECT, UPDATE and DELETE SQL queries. Being able to perform these operations using Entity Framework Core is a great way to allow the MyBGList Web API application we're working with to interact with the DBMS we've set up in the previous chapter using a uniform, well-structured, and convenient approach.
In this chapter we'll perform several read and write operations required by our concrete scenario against our Data Model using the EF Core's ApplicationDbContext
class: these tasks will greatly help us to develop the required skills to interact with our database for the rest of the book.