20/04/2015
What is the Entity framework?
before using EF you should know the following approach...
The Entity framework is an object-relation mapper, means - it takes the structure of the database and turns it into objects that the .Net framework can understand. Developers use those object to interact with the database instead of interacting with database directly. It’s possible to perform the full set of Create, Read, Update, and Delete (CRUD) operations using the Entity Framework features.
It has three work flows
1. Code – first,
2. Model-first and
3. database first.
Choosing and using the right approach can save developers a lot of time and effort, especially when interacting with complex database design.
Understanding the Code First Work-flow
The code first approach is introduced in Entity Framework 4.1, and is a latest workflow Microsoft has introduced. It lets us transform our coded classes into a database application, which means code first lets us to define our domain model using POCO (plan old CLR object) class rather than using an xml - based EDMX files, which has no dependency with entity framework. Our model classes becomes the domain model, there for we most have to be very conscious in designing our model classes. And the rest work will be done by entity-frame work. This is the beauty of the code first approach where our model classes are become the data models on which Entity framework relies.