Sunday, May 7, 2017

LINQ TO SQL , LINQ to Entities




  • all of them are LINQ - Language Integrated Query - so they all share a lot of commonality. All these "dialects" basically allow you to do a query-style select of data, from various sources.
  • Linq-to-SQL is Microsoft's first attempt at an ORM - Object-Relational Mapper. It supports SQL Server only. It's a mapping technology to map SQL Server database tables to .NET objects.
  • Linq-to-Entities is the same idea, but using Entity Framework in the background, as the ORM - again from Microsoft, but supporting multiple database backends
  • Linq-to-DataSets is LINQ, but using is against the "old-style" ADO.NET 2.0 DataSets - in the times before ORM's from Microsoft, all you could do with ADO.NET was returning DataSets, DataTables etc., and Linq-to-DataSets queries those data stores for data. So in this case, you'd return a DataTable or DataSets (System.Data namespace) from a database backend, and then query those using the LINQ syntax


https://weblogs.asp.net/dixin/entity-framework-core-and-linq-to-entities-1-remote-query

https://www.tektutorialshub.com/linq-to-entities-tutorial/


http://www.entityframeworktutorial.net/EntityFramework-Architecture.aspx



LINQ to SQL
It only works with SQL Server Database.
It generates a .dbml to maintain the relation
It has not support for complex type.
It cannot generate database from model.
Entity Framework
It can works with various databases like Oracle, DB2, MYSQL, SQL Server etc.
It generates an .edmx files initially. The relation is maintained using 3 different files .csdl, .msl and .ssdl
It has support for complex type.
https://sites.google.com/site/19216811wiki/