why we should use entity framework in asp.net and benefits of entity framework? [Resolved]

Posted by Kumaran under ASP.NET MVC on 6/18/2014 | Points: 10 | Views : 1922 | Status : [Member] | Replies : 8
why we should use entity framework in asp.net and benefits of entity framework?




Responses

Posted by: Goud.Kv on: 6/18/2014 [Member] [MVP] Gold | Points: 50

Up
0
Down

Resolved
Here are the Benifits of using Entity Framework
There are so many reasons why we should use entity framework over LinqToSql and ADO.NET.

1. Database performance is improved. Updating your EDM based on your DB changes would take less time rather than the conventional methods. Database operations like select, insert, update, delete will work faster as you don't have to hit database again and again as you would be working with objects not with database tables.

2. Entity Framework performing basic CRUD (Create, Read, Update, Delete) operations. So most of the time you don't have to write any SQL yourself. When you make any changes to the object, the ORM will usually detect this, and mark the object as 'modified'. When you save all the changes in your ORM to the database, the ORM will automatically generate insert/update/delete statements, based on what you did with the objects.

3. Entity Framework works on databases other than Microsoft SQL Server, like Oracle, MySQL etc. While Linq is limited to MS SQL Server. It is easy to add support for another database (like Oracle) as we are programming against a model.

4. Easily managing "1 to 1", "1 to many", and "many to many" relationships.

5. Ability to have inheritance relationships between entities.

Thanks & Regards,
Krishna

Kumaran, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Goud.Kv on: 6/18/2014 [Member] [MVP] Gold | Points: 25

Up
0
Down

Resolved
Entity Framework overcomes ADO.NET as we use in ASP.Net. I mean It communicates with the database and sets relation between our application and our database.
Advantages over ADO.NET are,
-No need to write any Queries for CRUD operations as we do in ADO.NET.
-.edmx file(which imports tables and procedures that are needed) creates auto generated code based on relations such as Tables created as Classes and Columns created as Properties.

Thanks & Regards,
Krishna

Kumaran, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Goud.Kv on: 6/18/2014 [Member] [MVP] Gold | Points: 50
Posted by: Goud.Kv on: 6/18/2014 [Member] [MVP] Gold | Points: 25

Up
0
Down
Hello Arun,
You may simply refer this page to know about Entity Framework http://www.codeproject.com/Articles/363040/An-Introduction-to-Entity-Framework-for-Absolute-B
Hope this is good for you,

Thanks & Regards,
Krishna

Kumaran, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Kumaran on: 6/18/2014 [Member] Starter | Points: 25

Up
0
Down
Thank you for your immediate response. i understood everything. But i don't know how the relationship is working can you please give some example for the relationship?

Kumaran, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Kumaran on: 6/18/2014 [Member] Starter | Points: 25

Up
0
Down
Good post.I don't know How to do mapping '1 to 1 ,'1 to many ' and 'many to many ' relationship in entity framework.

Kumaran, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Kumaran on: 6/18/2014 [Member] Starter | Points: 25

Up
0
Down
My big thank for your clear explanation

Kumaran, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Goud.Kv on: 6/18/2014 [Member] [MVP] Gold | Points: 25

Up
0
Down
Any time Arun.

Thanks for posting at DotNetFunda.

Thanks & Regards,
Krishna

Kumaran, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response