C# Entity framework interview questions with answers: - What is the difference between POCO, code first and simple EF approach?
- By Shiv Prasad Koirala in C#
- Aug 17th, 2013
- 398
- 0
All these three approaches define how much control you want on your code. Entity framework is an OR MAPPER it generates lot of code, it creates your middle tier (Entity) and Data access layer (Context).
But lot of times you want to enjoy benefits of both the world you want the auto-generation part to minimize your development time and also you want control on the code so that you can maintain code quality.

Below is the difference table which defines each of the approaches. In Simple entity framework everything is auto generated and so you need the EDMX XML file as well. POCO is semi-automatic so you have full control on the entity classes but then the context classes are still generated by the EDMX file.
In code first you have complete control on how you can create the entity and the context classes. Because you are going to manually create these classes you do not have dependency on the EDMX XML file. Below is a simple table which shows the cross comparison.
|
|
EDMX |
Entity |
Context |
|
Simple entity framework |
Needed |
Auto |
Auto |
|
POCO approach |
Needed |
Manual |
Manual |
|
Code First |
Not Needed |
Manual |
Manual |
We are thankful to questpond.com to sponsor this c# Entity framework interview questions with answers.
Shiv Prasad Koirala
Visit us @ www.questpond.com or call us at 022-66752917... read more
- By Shiv Prasad Koirala
- Jan 17th, 2012
- 13447
- 0
.NET interview questions: - Can you elaborate project life cycle?
- By Shiv Prasad Koirala
- Aug 3rd, 2011
- 10211
- 0
Five most important SharePoint 2010 interview questions
- By Shiv Prasad Koirala
- Nov 16th, 2011
- 9938
- 0

