Tag Archives: Microsoft Entity Framework

Microsoft Entity Framework

  • entity1
  • entity2
  • entity3
  • entity4
  • entity5
  • entity6
  • entity7
  • entity8
  • entity9
  • entity10
The Microsoft Entity Framework is an Object Relational Mapping (O/RM) tool that enables you to generate a data access layer from a database automatically. The Entity Framework enables you to avoid the tedious work of building your data access classes by hand.
** Alternatives to Entity Framework – Microsoft LINQ to SQL, NHibernate, or SubSonic
Sample Project – MVC with Entity Framework
Final Output
After Creation MVC project from the Project Template- Create Entity Data Model-from an Exiting Database in SQL- Click Add New Item from Model- Select ADO.NET Entity Data Model.
Select Genearate from Model
In Order to Access the Existing Database – provide the Database Connection
Select the Tables to include in Entity Model and Give a Namespace
Select the Entity and Verify the Entity Type Name and See if its made Plural, you can change it to Singular
Right Click on Model Window and Verify the Namespace
Go to the Controller- Verify the Namespaces, Create a Constructor to Initialize The Entity, In the the Corresponding Action,Fetch  the Data using Entity and Assign it to Model
In the View- the Page Inherits from the Specific Model
When we add an Entity Model, it makes an entry into the Web.config