Advantages
Disadvantages
- Faster development
- Unit of work pattern (context)
- Auto-generated domain objects that are usable small projects
- Lazy loading.
- Learning to write linq queries/lambdas is a must learn for .NET developers.
- Quick turn around for development
- Queries can be dynamically
- Tables are automatically created into class
- Columns are automatically created into properties
- Relationship are automatically appeaded to classes
- Lambda expressions are awesome
- Data is easy to setup and use
- LINQ offers a common syntax for querying any type of data sources
- LINQ expedites development time by catching errors at compile time and includes IntelliSense & Debugging support
- LINQ expressions are Strongly Typed.
Disadvantages
- No clear outline for Tiers
- No good way of view permissions
- Small data sets will take longer to build the query than execute
- There is an overhead for creating queries
- When queries are moved from sql to application side, joins are very slow
- DBML concurrency issues
- Hard to understand advance queries using Expressions
Difference between LINQ and Stored Procedure
- In this Artical differences existing between LINQ and Stored procedures. These differences are mentioned below.
- Stored procedures are much faster than a LINQ query as they follow an expected execution plan.
- It is easy to avoid run-time errors while executing a LINQ query than in comparison to a stored procedure as the former has Visual Studio’s Intelligense support as well as full-type checking during compile-time.
- LINQ allows debugging by making use of .NET debugger which is not in case of stored procedures. Easly debugg in linq
- LINQ offers support for multiple databases in contrast to stored procedures in SQL, where it is essential to re-write the code for diverse types of databases.
- Deployment of LINQ based solution is easy and simple in comparison to deployment of a set of stored procedures in SQL. Using linq query it is complex when use jin in query and performance is slow as compare store procedure in Sql
Difference between LINQ to SQL v/s Entity Framework
LINQ to SQL | Entity Framework |
---|---|
It is only works with SQL Server Database you can write query with sql. | It can works with various multiple databases like Oracle, DB2, MYSQL, SQL Server etc. |
LINQ to SQL use then generates .dbml to maintain the relation. | It generates an .edmx files initially. The relation is maintained using 3 different files .csdl, .msl and .ssdl |
LINQ to SQL it has not support for complex type. | Entity Framework has support for complex type. |
LINQ to SQL allows only one to one mapping between the entity classes and the relational tables /views. | Entity Framework allows one-to-one, one-to-many & many-to-many mappings between the Entity classes and the relational tables /views |
Linq to sql allows you to query data using DataContext. | Entity Framework allows you to query data using EntitySQL, ObjectContext, DbContext. |
LINQ to SQL provides a tightly coupled approach. | Entity Framework provides a loosely coupled approach. Since its code first approach allow you to use Dependency Injection pattern which make it loosely coupled . |
LINQ to SQL can be used for rapid application development only with SQL Server. | Entity Framework can be used for rapid application development with RDBMS like SQL Server, Oracle, DB2 and MySQL etc. |
LINQ to SQL is a complex type and it reduce performance as compare to Entity Framework. | Entity Framework is fast and less complex as compare to LINQ to SQL. |
0 comments :
Post a Comment