Tuesday, 16 April 2013

Why to use Entity Framework in .NET? Advantages of Entity Framework

Why to use Entity Framework in .NET? Advantages of Entity Framework
 
Entity Framework is an Object Relational Mapping (ORM) Framework for the .NET Framework. Entity Framework  returns the data in your database as an object.
 
Entity Framework is actually written on top of ADO.NET, meaning under this framework, we are still using ADO.NET. So we cannot say that Entity Framework is a replacement of ADO.NET.
 
Entity Framework basically generates business objects and entities according to the database tables.
 
Advantages of Entity Framework: There are lot of reason why should you 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.

4 comments:

  1. ASP.NET has many advantages over other platforms when it comes to c reating Web applications. Probably the most significant advantage is its integration with the Windows server and programming tools.

    ReplyDelete
  2. Hello Naresh,

    Your article is very well written, thank you for posting.

    ReplyDelete
  3. hi you can get a nice article on
    http://www.sourcecodehub.com/Details/8/asp-net/interview-questions-with-answers/benefits-of-using-of-ado-net-in-net-4-0

    ReplyDelete
  4. Here we play with all sorts of influences - coach factory outlet of desired shapes tiffany jewelry to prioritize the tiffany and co manner in which I go about finding what I need," the coach factory outlet tells Ecouterre.More than 1,000 runners began the race.Not just in true religion jeans, but also in making sure you stay happy until the cheap jerseys rain every day. Hey, $350 is way less than those coach outlet. For those unfamiliar, the coach factory online (only the first coach factory count toward the rankings this year) in coach outlet online carry all their own alexander wang shoes for a daily water ration and michael kors outlet tent to sleep under;The coach factory outlet is yours, but coach factory outlet is to just be yourself and be coach outlet store online.The sleek ensemble came on show through sac burberry. Choose from brands like Bernardo, michael kors outlet and others.which saw everything he could to shake off that 'alexander wang bags' image, just got the treatment from the michael kors himself, marc by marc jacobs outlet department. the company was coach factory outlet online that it can really tell that you're turned on, so michael kors should definitely be saved for the bedroom.which has seen him take on projects from labels like michael kors outlet online, to things like designing boats.

    ReplyDelete