Model Domain Objects with the Entity Framework: Table 2: Compare EF Beta 3 Features with LINQ to SQL RTM.

The basic distinction between these two O/RMs is that Entity Framework (EF) is targeted at enterprise scenarios, while LINQ to SQL is best suited for rapid application development (RAD) with SQL Server 200x and, to a lesser extent, SQL Server Compact Edition 3.5. However, your O/RM tool choice might be influenced or even determined by support for one or more of the features in this table.
Feature Entity Framework Implementation LINQ to SQL Implementation
Supported databases Any relational database with an Entity Framework-enabled ADO.NET data provider; SQL Server 200x is the default; Third-party providers for IBM-DB2,
Firebird, Informix, Ingres, MySQL, Oracle, PostgreSQL, SQLite and VistaDb are available or in development
SQL Server 200x and partial (non-
graphical) support for SQL Server
Compact Edition 3.5 only
Inheritance model Table per type, table per concrete type, table per
hierarchy
Table per hierarchy only
Type and collection names Independent; it’s typical to edit type names to
singular and accept default plural collection names
Type and collection names are the same; names are singularized by default
Schema independence Three-tier mapping layer makes domain object model independent to database schema; can map multiple tables to a single entity or vice versa Direct, one-to-one mapping; Domain objects are created directly from the database and bound to its schema
Update model when
database schema changes
Automated Manual
Graphical designer Multi-pane entity view with tree-view Model Browser and tabular table column to property mapping window Dual-pane class view with Methods pane for stored procedure assignment
Three-tier WCF
service architecture
"Perseus" add-on code enables serializing CRUD
operations between physical tiers with WC
LINQ to SQL has no "out-of-the box
n-tier story"
Many:many relations Supported without relation table if no payload Relation table required
Complex (value) types Supported Not supported
Loading related entities Explicit load instruction required; eager loading is
the default
Implicit lazy loading is the default; explicit eager loading is optional
Related entity loading management for sort
order and depth
Requires use of the EntityCollection.Attach() and
EntitySet.CreateSourceQuery() methods
Simple LINQ predicates or stored procedures applied to DataContext
Foreign key value
visibility
Not visible; association endpoints (EntityReferences and EntitySets) replace foreign keys Visible; foreign keys supplement association endpoint
High-performance, low-overhead DataReaders Supports hierarchical/polymorphic DataReaders Not supported
Query languages LINQ to Entities, Entity SQL, and ObjectQuery (uses
Entity SQL)
LINQ to SQL (most Standard Query
Operators)
Stored procedure support  All CRUD operation All CRUD operation
comments powered by Disqus
Upcoming Events

.NET Insight

Sign up for our newsletter.

I agree to this site's Privacy Policy.