Category Archives: Uncategorized

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

ASPX and Razor View Engine introduced in MVC3

Razor is an alternative view engine for Asp.net MVC apps, and is implemented by entirely different code than .aspx

The Razor Syntax, Server Code, and ASP.NET

Razor syntax is a simple programming syntax for embedding server-based code in a web page. In a web page that uses the Razor syntax, there are two kinds of content: client content and server code. Client content is...
Read more