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

Featured

  • AI for GitHub Collaboration? Maybe Not So Much

    No doubt GitHub Copilot has been a boon for developers, but AI might not be the best tool for collaboration, according to developers weighing in on a recent social media post from the GitHub team.

  • Visual Studio 2022 Getting VS Code 'Command Palette' Equivalent

    As any Visual Studio Code user knows, the editor's command palette is a powerful tool for getting things done quickly, without having to navigate through menus and dialogs. Now, we learn how an equivalent is coming for Microsoft's flagship Visual Studio IDE, invoked by the same familiar Ctrl+Shift+P keyboard shortcut.

  • .NET 9 Preview 3: 'I've Been Waiting 9 Years for This API!'

    Microsoft's third preview of .NET 9 sees a lot of minor tweaks and fixes with no earth-shaking new functionality, but little things can be important to individual developers.

  • Data Anomaly Detection Using a Neural Autoencoder with C#

    Dr. James McCaffrey of Microsoft Research tackles the process of examining a set of source data to find data items that are different in some way from the majority of the source items.

  • What's New for Python, Java in Visual Studio Code

    Microsoft announced March 2024 updates to its Python and Java extensions for Visual Studio Code, the open source-based, cross-platform code editor that has repeatedly been named the No. 1 tool in major development surveys.

Subscribe on YouTube