SyntaxFix
Write A Post
Hire A Developer
Questions
🔍
[.net] Entity Framework vs LINQ to SQL
Home
Question
Entity Framework vs LINQ to SQL
LINQ to SQL
Homogeneous datasource: SQL Server
Recommended for small projects only where data structure is well designed
Mapping can be changed without recompilling with SqlMetal.exe
.dbml (Database Markup Language)
One-to-one mapping between tables and classes
Supports
TPH
inheritance
Doesn't support complex types
Storage-first approach
Database-centric view of a database
Created by C# team
Supported but not further improvements intended
Entity Framework
Heterogeneus datasource:
Support many data providers
Recommended for all new projects except:
small ones (LINQ to SQL)
when data source is a flat file (ADO.NET)
Mapping can be changed without recompilling when setting model and mapping files Metadata Artifact Process to Copy To Output Directory
.edmx (Entity Data Model) which contains:
SSDL (Storage Schema Definition Language)
CSDL (Conceptual Schema Definition Language)
MSL (Mapping Specification Language)
One-to-one, one-to-many, many-to-one mappings between tables and classes
Supports inheritence:
TPH (Table Per Hierarchy)
TPT (Table Per Type)
TPC (Table Per Concrete Class)
Supports complex types
Code-first, Model-first, Storage-first approaches
Application-centric view of a database
Created by SQL Server team
Future of Microsoft Data APIs
See also:
LINQ To SQL Vs Entity Framework
Difference between LINQ to SQL and Entity Framework
Entity Framework vs LINQ TO SQL
Examples related to
.net
•
You must add a reference to assembly 'netstandard, Version=2.0.0.0
•
How to use Bootstrap 4 in ASP.NET Core
•
No authenticationScheme was specified, and there was no DefaultChallengeScheme found with default authentification and custom authorization
•
.net Core 2.0 - Package was restored using .NetFramework 4.6.1 instead of target framework .netCore 2.0. The package may not be fully compatible
•
Update .NET web service to use TLS 1.2
•
EF Core add-migration Build Failed
•
What is the difference between .NET Core and .NET Standard Class Library project types?
•
Visual Studio 2017 - Could not load file or assembly 'System.Runtime, Version=4.1.0.0' or one of its dependencies
•
Nuget connection attempt failed "Unable to load the service index for source"
•
Token based authentication in Web API without any user interface
Examples related to
entity-framework
•
Entity Framework Core: A second operation started on this context before a previous operation completed
•
EF Core add-migration Build Failed
•
Entity Framework Core add unique constraint code-first
•
'No database provider has been configured for this DbContext' on SignInManager.PasswordSignInAsync
•
The instance of entity type cannot be tracked because another instance of this type with the same key is already being tracked
•
Auto-increment on partial primary key with Entity Framework Core
•
Working with SQL views in Entity Framework Core
•
How can I make my string property nullable?
•
Lazy Loading vs Eager Loading
•
How to add/update child entities when updating a parent entity in EF
Examples related to
linq-to-sql
•
Understanding SQL Server LOCKS on SELECT queries
•
how to update the multiple rows at a time using linq to sql?
•
LINQ: combining join and group by
•
LINQ to SQL: Multiple joins ON multiple Columns. Is this possible?
•
How to Select Min and Max date values in Linq Query
•
How to do a LIKE query with linq?
•
How to do a join in linq to sql with method syntax?
•
How to store a list in a column of a database table
•
Returning IEnumerable<T> vs. IQueryable<T>
•
Entity Framework VS LINQ to SQL VS ADO.NET with stored procedures?