Difference between linq and sql and entity infrastructure

There is one difference between Linq and Sql, and an Entity structure such as Linq to SQL is a one to one mapping, and EF is many to many, and many more that can be found in the Entity Framework vs LINQ to SQL

But here I ask a question with EF and Linq in Sql, we first create Entities, and then generate tables or in another way, as well as what are the positive and negative sides of both approaches. In EF, there can exist any business objects that inherit from several tables and do not represent any thing in the database. Is Linq for objects different from EF?

Please let me know if the question is incomprehensible or incorrectly asked. Thanks in advance guys.

+3
linq linq-to-sql entity-framework
source share
3 answers

For production releases of both EF and L2S, a data model (read: database schema) must be installed before any classes are created. The ability to first create your classes and then generate databases that are available as CTP EF4, which ScottGu blogged about the recent past.

As for the only Entity, reflecting several tables: I believe that at present this is a one-to-one relationship: 1 table = 1 Entity.

+2
source share

I believe that with EF 4 or an add-in, you can first create your own model and create its database schema. Before EF 4 and with Linq-to-SQL, you need to start from the database and map the models.

+2
source share

in linq to SQL, you first create the database, then import it, create the application, and your objects will be created.

I started cheating on EF when I first studied MVC, then when I started working with the code that I used linq for SQL, and, like linq, there is no real difference in the linq queries I can say.

+1
source share

All Articles