Introduction
In this chapter, we will learn how to create a data access layer with the object relational mapper called Entity Framework. We will configure its IOC life cycle, create a CRUD with and without stored procedures, and log and manage exceptions.
We will first explain some concepts used internally by Entity Framework that are recurrent in ORMs, and then we will see which of the EF features no longer exist in EF.
ORM is a library that maps data classes with datatables in a database, such as Customer
class maps with a Customer table in a database, BankTransaction
class maps with a BankTransaction
table in a database, and so on.
ORM libraries help developers build data access layers without the hassle of table query complexities. For example, they can help you set the IsDeleted
field in the next 20 rows of a table to False
. It's so easy to write these kinds of queries with ORM libraries.
DbContext
An ORM uses the code representation of a SQL schema to request databases. Originally, they...