United States   Change   |   All Microsoft Sites

Home

ADO.NET Entity Framework

SQL Server 2008 ADO.NET Entity Framework

Overview

The Microsoft ADO.NET Entity Framework simplifies application data access by providing an extensible, conceptual model for data from any database and enables this model to closely reflect business requirements.

Top New Features

  • Map complex data structures in underlying stores to easy-to-understand business objects that can be used in applications

  • Extend modeling files and generated classes to meet business requirements

  • Use LINQ to Entities to create easy-to-maintain code that retrieves and works with entities

  • Use strongly typed data objects

  • Easily change the data structure or data source without changing application code

Mapping Tables to Entities

Mapping Tables to Entities

Adaptive Modeling

Separate the logical storage model of data from the conceptual model used in the application. Create a concrete implementation of your model and work with business entities in the application, without worrying about the underlying structure of the database.

 

Abstract tables to entities

  • Map tables in a database to a conceptual model as entities in your application by using the mapping capabilities of the ADO.NET Entity Framework

  • Map multiple related tables to a single entity and reduce code complexity

Model many-to-many relationships

  • Map many-to-many relationships directly without an intermediary join

Enable inheritance in the database

  • Relational data is inherently tabular, whereas object oriented programming languages work with entities that can be represented as objects that inherit characteristics from parent objects

  • Use the ADO.NET Framework to bridge this divide and create a model that supports the three common inheritance storage schemas:

    • Table per hierarchy: One table contains data for all types within the hierarchy and one column discriminates between the types.

    • Table per subclass: One table contains the base properties across the type hierarchy, with separate tables for additional properties defined for each subtype

    • Table per concrete type: One table contains all the properties of a concrete class, including inherited properties

Build custom data views

  • Automatically generate client views from the conceptual data model by using declarative mappings. Override these mappings to customize the data returned by a query

  • Use a QueryView to return a subset of data by specifying an Entity SQL WHERE clause

  • Use a DefiningQuery to specify the required data by using the full syntax of the store’s native query language

Reduce code by consolidating related objects

  • Represent a group of related objects as a composite object using complex types. For example, use an Address complex type to group Street, City, State, and Zip Code objects

Entity Framework Diagram

Entity Framework Diagram

Extensible

Customize the generated entities and objects for your specific business needs.

Customize modeling files to meet business requirements

  • Use a schema-aware XML editor to add metadata or modify properties in the automatically generated modeling and mapping files

Customize generated code to incorporate business logic

  • Add business logic to data access code in the application

  • Extend the generated partial classes with functionality needed by the application

  • Create custom implementations of the partial classes’ base interfaces

Entity Designer

Entity Designer

Evolutionary

Use the next generation of ADO.NET to abstract away the details of working with data at the logical database level.

Simplify modeling and mapping

  • Microsoft Visual Studio 2008 is evolving to help developers move to the ADO.NET Entity Framework for their data access requirements

  • Visually design and work with models and mappings by using the Entity Framework Tools in Visual Studio 2008

  • Entity Designer. Generate models, edit properties, and validate models and mappings

  • Entity Mapping tool. Define entities and associations from tables

  • Entity Model Browser. Visualize the model in a tree hierarchy

Use new functionality in a familiar way

  • Use the concepts of the ADO.NET data provider model, while taking advantage of the features of the new framework

  • Query against the conceptual models in the ADO.NET Entity Framework, rather than against the logical model of a database implementation, by using the EntityClient data provider

Write better code

  • Use the Entity Framework to query and return results as strongly typed CLR data objects by using Entity SQL or LINQ

  • Simplify coding by taking advantage of Visual Studio 2008 IntelliSense support in the strongly typed classes

Simplify application maintenance

  • By using entities in place of traditional data access code, changes to the underlying database schema do not always require changes to the application code

  • Extend your applications to use more powerful editions of SQL Server with minimal changes to the code by programming against conceptual entities instead of logical tables

ADO.NET 3.5 Data Providers with Support for the Entity Framework

The ADO.NET Entity Framework simplifies data access code in applications by enabling developers to create a customizable conceptual model for data from any source and easily map it to business requirements.

The ADO.NET Entity Framework is database independent and built upon a standard ADO.NET Provider model that allows access to third-party databases through the use of ADO.NET Data Providers. These third-party providers are currently available.

 

Devart
Devart

Devart's offers ADO.NET Data Providers supporting access to Oracle, MySQL, and PostgreSQL databases via the .NET Framework 3.5 Service Pack 1 and Visual Studio 2008 Service Pack 1, including the ADO.NET Entity Framework.

 

Phoenix Software Solutions

Phoenix Software Solutions

Phoenix Software Solutions offers an ADO.NET Data Provider supporting access to SQLite via the .NET Framework 3.5 Service Pack 1 and Visual Studio 2008 Service Pack 1, including support for the ADO.NET Entity Framework.

 

Npgsql

Npgsql

Npgsql is an ADO.NET provider for PostgreSQL. It is built with 100% managed code and provides .NET applications with the latest ADO.NET features for accessing a PostgreSQL database.

 

OpenLink Software

OpenLink Software

OpenLink's Virtuoso ADO.NET Entity Framework provider allows developers to access native Virtuoso data (SQL, XML, and RDF) and any Virtuoso Linked Tables from external ODBC and JDBC accessible data sources using LINQ, Entity SQL and ADO.NET Data Services.  Known-compatible external data sources include Oracle (versions 7.x to 11.x), Microsoft SQL Server (6.x to 2005), IBM DB2 , Sybase (4.2 to 12.x+), IBM Informix (5.x to 11.x), Ingres (6.4 to 9.x), Progress (7.x to 10.x), MySQL, PostgreSQL, and Firebird.

 

Sybase SQL Anywhere

Sybase SQL Anywhere

The release of SQL Anywhere 11 includes Sybase iAnywhere's ADO.NET Data Provider that includes Entity Framework support, allowing Sybase developers to access SQL Anywhere databases via LINQ, Entity SQL and ADO.NET Data Services.

 

Firebird

Firebird

Written in C#, the .NET Data Provider software is an official sub-project of Firebird, developing and maintaining a high-performance native implementation of the API functions exposed as Firebird's client layer. This enables .NET applications to access Firebird databases without installing the Firebird client library.

 

Synergex

Synergex

Synergex offers the Synergy/DE Data Provider for .NET, which enables developers to access Synergy DBMS databases from .NET applications and Visual Studio 2008 and take advantage of Microsoft's ADO.NET Entity Framework and LINQ.

 

IBM

IBM

IBM's Data Server Provider for .NET allows developers to access DB2, Informix and U2 databases via LINQ, Entity SQL and ADO.NET Data Services.

 

Additional Resources

Case Studies

 

Take the next step

Download the Essential Backpack
TechNet IT Pros Start Here
MSDN Developers Start Here