0% found this document useful (0 votes)
20 views1 page

Entity Framework QA

Uploaded by

dhaygudesuraj261
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views1 page

Entity Framework QA

Uploaded by

dhaygudesuraj261
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Entity Framework Question-Answer

1. Entity Framework and its approaches ?


 Entity framework is used to communicate with the database.
 Entity Framework approaches are
1) Database First
- Database first approach creates the entity framework from a existing database.
2) Code First
- Code first approach create database that doesn’t exists.
- It can also be used if you have an empty database and then code first will add
new tables too.
3) Model First

2. Which approach you have used in your project and explain it ?


 We used both approaches (Database and Code first) as per requirement.

3. What is difference between ADO.net and Entity Framework ?


 ADO.net creates bunch of data layer code whereas Entity Framework doesn’t create
bunch of code.
 ADO.net is faster than entity framework because entity framework uses ado.net code
behind so entity framework requires some extra time cost.

4. What is DbContext ?
 DbContext is an important class in entity framework.
 DbContext is a bridge between entity classes and database.
 DbContext is the primary class that is responsible for interacting with the database.
 DbContext Savechanges method executes Insert, Update and Delete commands to the
database.

5. What is Dbset ?
 The context class derived from DbContext must include the Dbset type properties for the
entities which maps the database table and views.

You might also like