
Prior to .NET 3.5, we (developers) often used to write ADO.NET code orEnterprise Data Access Block to save or retrieve application data from theunderlying database. We used to open a connection to the database, create aDataSetto fetch or submit the data to the database, convert data from the DataSet to .NET objects or vice-versa to apply business rules.
Before starting your code it’s very important to understand the process of using EF in your application.
in this video you will learn how EF acts in visual studio.
Entity Framework API includes mapping domain classes to the database schema,translate & execute LINQ queries to SQL, track changes occurred on entities during their lifetime, and save changes to the database.
Context Class is a most important part in EF,It shows a session with the underlying database using which you can perform CRUD (Create, Read, Update, Delete) operations.
An entity in Entity Framework is a class that maps to a database table. This class must be included as a DbSet<TEntity> type property in the DbContextclass. EF API maps each entity to at able and each property of an entity to a column in the database
There are three different approaches you can use while developing your application using Entity Framework:
Database-First
Code-First
Model-First
Prior to .NET 3.5, we (developers) often used to write ADO.NET code or Enterprise Data Access Block to save or retrieve application data from the underlying database. We used to open a connection to the database, create a DataSet to fetch or submit the data to the database, convert data from the DataSet to .NET objects or vice-versa to apply business rules. This was a cumbersome and error prone process. Microsoft has provided a framework called "Entity Framework" to automate all these database related activities for your application.