Website Design Chester by the Informatics Centre

Using Entity Framework

Entity Framework (EF) is a Microsoft technology designed to support object oriented web application design when working with .NET. It is an object-relational mapper, allowing developers to concentrate on the logic of the design rather than worrying about data access.

Your data objects are described by their own classes and can be used in your program as such. EF provides an abstraction layer when it comes to writing to or reading from your database, allowing you to treat database actions as just another object method. This is ideal for developers who are more comfortable with programming that they are with data access. You don't need to write SQL statements or worry about where your data is eventually going to end up. It also allows the developer to work with different data sources using the same code and methods with EF doing the required translation when working with your data.

When beginning development the developer has three options, Database First, Model First and Code First. Database first allows you to reverse engineer an already existing database, creating the model and classes you need from it. Model first allows the developer to create the data model and then automatically generate both the classes and the database from it. Finally Code First allows the developer to model the classes and their mappings in code and then either create a database from this model or map them to an existing database.

For more information look at the MSDN Site on Entity Framework

View all Informatics Centre blog posts.