Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

Should i use linq to sql?


Asked by Jayson Palacios on Dec 07, 2021 SQL



LINQ to SQL has many overlaps with other ORM products, but because it is designed and built specifically for .NET and SQL Server, it has many advantages over other ORM products. For example, it takes the advantages of all the LINQ features and it fully supports SQL Server Stored Procedures.
Keeping this in consideration,
In LINQ to SQL, the data model of a relational database is mapped to an object model and while executing application the LINQ queries object model converted into SQL to get the required data from the database. While returning the data from database the LINQ to SQL will convert SQL results to the LINQ objects model.
Moreover, In the case of LINQ to SQL or Entity Framework, the translation engine will convert the query (that we composed in two steps) into a single SQL statement optimized for the database server to which it's connected. You might have noticed another more subtle (but important) benefit of the LINQ approach.
Also Know,
Developers can use LINQ with any data source. They can express efficient query behavior in their programming language of choice, optionally transform/shape data query results into whatever format they want, and then easily manipulate the results.
Indeed,
Visual Studio 2008 and the corresponding Express Editions come with a visual designer which makes it easy to model and visualize a database as a LINQ to SQL object model. Let's create a console project by following the steps outlined in the Introduction to LINQ tip.