Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. LINQ
  4. A question regarding 'Entity Model' vs. 'Linq to SQL' and how they differ

A question regarding 'Entity Model' vs. 'Linq to SQL' and how they differ

Scheduled Pinned Locked Moved LINQ
questioncsharpdatabasevisual-studiolinq
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Michael Eber
    wrote on last edited by
    #1

    I've been using Linq to Sql ever since it first came out. Now there are comments floating around that there are two accesses to data: Entity Model and L-t-S. I must have my head in my butt because this is news to me. I've always used the L-t-S dbml to build my entity objects (which IS an entity model, n'est pas?) I then do all of my queries off of the context object. So how does this differ from what people are calling the Entity Model....and why would MS put all the time and effort into doing L-t-S only to now say they may drop it in 4.0???? Is it simply using the entity model if I use the method extensions? I actually found them harder to use!!! My assumption is this: Linq to Sql:

    MyContext context = new MyContext();
    context.Open();
    var q = from t in context.Titles
    where t.Author.Equals(authorName)
    select t;

    and thus the so-called Entity model????:

    MyContext context = new MyContext();
    context.Open();
    var q = context.Titles.Select( t => t.Author.Equals(authorName) );

    The first example seems clearer than the second....unless I misunderstand what the Entity Model is. One confused develolper.

    R 1 Reply Last reply
    0
    • M Michael Eber

      I've been using Linq to Sql ever since it first came out. Now there are comments floating around that there are two accesses to data: Entity Model and L-t-S. I must have my head in my butt because this is news to me. I've always used the L-t-S dbml to build my entity objects (which IS an entity model, n'est pas?) I then do all of my queries off of the context object. So how does this differ from what people are calling the Entity Model....and why would MS put all the time and effort into doing L-t-S only to now say they may drop it in 4.0???? Is it simply using the entity model if I use the method extensions? I actually found them harder to use!!! My assumption is this: Linq to Sql:

      MyContext context = new MyContext();
      context.Open();
      var q = from t in context.Titles
      where t.Author.Equals(authorName)
      select t;

      and thus the so-called Entity model????:

      MyContext context = new MyContext();
      context.Open();
      var q = context.Titles.Select( t => t.Author.Equals(authorName) );

      The first example seems clearer than the second....unless I misunderstand what the Entity Model is. One confused develolper.

      R Offline
      R Offline
      r3m1x
      wrote on last edited by
      #2

      Linq2Sql = SQL Server Linq2Entities(Entity framework) = many relational databases With linq2sql you can only map one class to one table but with linq2entites you can map one class to multiple tables but the biggest thing is linq2sql is designed for rapid development with sql server and entity framework is more built for enterprise level applications hope this helps!

      R 1 Reply Last reply
      0
      • R r3m1x

        Linq2Sql = SQL Server Linq2Entities(Entity framework) = many relational databases With linq2sql you can only map one class to one table but with linq2entites you can map one class to multiple tables but the biggest thing is linq2sql is designed for rapid development with sql server and entity framework is more built for enterprise level applications hope this helps!

        R Offline
        R Offline
        r3m1x
        wrote on last edited by
        #3

        So basically the linq2sql datacontext and the linq2entities entity model are different. With Visual studio 2008 service pack 1 ships with entity framework. Basically from my understanding the entity framework missed its deadline when visual studio 2008 was getting ready to ship, so they shipped linq2sql instead and waited for sp1 to release the entity framework. You can use one or the other, they both are ORMs shipped with visual studio, its just a matter of preference and what type of application you are developing. To me I prefer linq2sql as I do rapid development, so usually in a larger scale project I would choose the entity framework and there are differences as I stated above and more.

        M 1 Reply Last reply
        0
        • R r3m1x

          So basically the linq2sql datacontext and the linq2entities entity model are different. With Visual studio 2008 service pack 1 ships with entity framework. Basically from my understanding the entity framework missed its deadline when visual studio 2008 was getting ready to ship, so they shipped linq2sql instead and waited for sp1 to release the entity framework. You can use one or the other, they both are ORMs shipped with visual studio, its just a matter of preference and what type of application you are developing. To me I prefer linq2sql as I do rapid development, so usually in a larger scale project I would choose the entity framework and there are differences as I stated above and more.

          M Offline
          M Offline
          Michael Eber
          wrote on last edited by
          #4

          Thanks. I saw the one entity model template but avoided it since it was called ADO.NET. ;) So I'm sure in code my consumption of it will be somewhat different but I'm very comfortable with Linq to SQL. Thanks for explaining the differences.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups