What Is LINQ to SQL


Linq stands for Language Integrated Query. LINQ to SQL is an ORM (object relational mapping) which allows you to model a relational database using .NET classes.

ORM is not a new for some programmer which already using these mapping tools in Java. Before Linq to sql many .net programmer already using such type of tools like Nhibernate and Sub-Sonic. But due to Microsoft tools its more friendly and easy to learn compare to other ORM in market. You can use native language to query the database using LINQ, With Linq you can  select/update/insert/delete data from database.

In LINQ to SQL, the data model of a relational database is mapped to an object model expressed in the programming language of the developer. When the application runs, LINQ to SQL translates into SQL the language-integrated queries in the object model and sends them to the database for execution. When the database returns the results, LINQ to SQL translates them back to objects that you can work with in your own programming language.

LINQ to SQL DMBL designer create DBML file which container classes and properties which mapped to database table reduce the workload for the database application developer. In our tradition application our lots of time involve in creation of Business Objects and Data Access Layer. L2S designer create these classes and business objects for you.

L2S supports transactions, views, and stored procedures.  It also provides an easy way to integrate data validation and business logic rules into your data model. L2S automatically generate query on runtime.

Linq stands for Language Integrated Query. LINQ to SQL is an ORM (object relational mapping) which allows you to model a relational database using .NET classes.

ORM is not a new for some programmer which already using these mapping tools in Java. Before Linq to sql many .net programmer already using such type of tools like Nhibernate and Sub-Sonic. But due to Microsoft tools its more friendly and easy to learn compare to other ORM in market. You can use native language to query the database using LINQ, With Linq you can  select/update/insert/delete data from database.

In LINQ to SQL, the data model of a relational database is mapped to an object model expressed in the programming language of the developer. When the application runs, LINQ to SQL translates into SQL the language-integrated queries in the object model and sends them to the database for execution. When the database returns the results, LINQ to SQL translates them back to objects that you can work with in your own programming language.

LINQ to SQL DMBL designer create DBML file which container classes and properties which mapped to database table reduce the workload for the database application developer. In our tradition application our lots of time involve in creation of Business Objects and Data Access Layer. L2S designer create these classes and business objects for you.

L2S supports transactions, views, and stored procedures.  It also provides an easy way to integrate data validation and business logic rules into your data model. L2S automatically generate query on runtime.

ORM from Microsoft
Other non- Micorosft ORM in markets
Linq to sql
Entity Framework

NHibernate
Genome
LLBL Gen Pro
SubSonic
OpenAccess ORM by Telerik



Advantages of Linq

1. Linkq allows you to query collections like arrays, enumerable classes.
2. Linq support native language
3. Linq designer generate Data Access Layer for you.
4. Linq support Intellisense
5. Compile check when database changes
6. Easy and Faster development compare to Layer architecture
7. Unit of work pattern (context)
8. Auto-generated domain objects that are usable small projects
9. Lazy loading.
10. Linq to Sql Support for Lambdas Query.
11. Easy for developer who not more aware with Sql database.
12. Queries can be dynamically
13. Tables are automatically created into class
14. Columns are automatically created into properties
15. Relationship are automatically appeaded to classes
16. Linq support one to one mapping.
17. Linq support only MSSQL Server database.

Disadvantages of Linq

1. If you change any schema in database then you need to change in DBML file also.
2. More confusion and complicated when using sub-query and more join with LINQ.
3. More Lack for Layer Architecture Design.
4. More overhead to create queries run time.
5. DBML concurrency issues
6. Hard to understand advance queries using Expressions
7. Problem in deployment If you alter anything in database you need to deploy DBML file also.
8. Linq to Sql may be not support in future, because Microsoft already launched other more advance Many to Many relationship ORM , Entity Framework which is more better then L2S many ways.

Keywords

What Is LINQ to SQL


Previous
Next Post »
Thanks for your comment