Sunday, 22 April 2012

Difference between Linq to Sql AND Linq to Entity

LINQ to SQL
•  It use domain Model
•  It support only SQL server Database 
•  Data source contains Tables only
•  It is simple to use
•  rapid development done from this Model
•  It can map class to single table
•  It is hard to apply Inheritance 
•  dbml file only generated
•  Creation of complex properties is Not Supported
•  Query
    - LINQ to SQL (for select)
    - Data Context (for update, create, delete, store procedure, view)
•  Synchronization with Database if Database Schema is changed is not
    supported in this Model
•  Very slow performance for the first query
•  It doesn't support Continuous improvement of features in the future
•  Generate database from entity model is not supported
Entity Framework
•  It use conceptual data model
•  It support variety of databases
•  Data source contains tables, replication, reporting Services, BI and etc
•  It is complex to use
•  It has slower development but more capabilities
•  It can map class to multiple table
•  It is simple to apply Inheritance 
•  After compilation generate edmx file with 3 sections to represent the schema: 
    csdl, msl and ssdl
    csdl : Conceptual schema definition language
    msl  : mapping specification language
    ssdl : store schema definition language
•  Creation of complex properties is Not Supported in VS2010, 
    we can manually modify in .edmx file
•  Query :
    - LINQ to Entities (for select)
    - Entity SQL (is a derivative of Transact-SQL, it supports inheritance and associations)
    - Object Services (for update, create, delete, store procedure, view)
    - Entity Client (is an ADO.NET managed provider, it is similar to SQLClient, OracleClient,
etc. 
It provides several components like EntityCommand, EntityTransaction)
•  Synchronization with Database if Database Schema is changed is supported in this Model
•  Very slow performance for the first query.But overall performance is better than LINQ to SQL
•  It support Continuous improvement of features in the future
•  Generate database from entity model is not supported in VS2010


No comments:

Post a Comment