LINQ

LINQ Introduction – What is LINQ & Why We Use LINQ

Here, we will learn about LINQ with its advantages and disadvantages and whether to use LINQ in our applications or not. We will also see LINQ architecture with its diagram.

So the Question is What is LINQ?

Linq stands for Language Integrated Query. We can use Linq in C# or VB.NET and it was introduced in .NET version 3.5. We can use Linq to query data to various data sources such as XML, SQL Database, Generics, ADO.NET, etc based on our requirement.

Linq, as it is available in System. Linq namespace and its a set of extension methods to query the data. Linq allows us to interact with any type of data.

LINQ Architecture

We can use Linq with various data sources

  • Linq to Objects
  • Linq to Datasets
  • Linq to SQL
  • Linq to Entities
  • Linq to XML

Why use LINQ?

Linq is quite simple, a higher level than SQL. As we all know that SQL is executed in the SQL Server or any other database while Linq is written in the code behind and provides full intellisense and also checks the type at compile time so it helps us to avoid runtime errors for the query.

 

Advantages of LINQ
  • It provides us intellisense.
  • The query is checked at compile time
  • The query can be reused
  • We can debug the query using the debugger
  • It supports filtering, sorting with much less effort
Disadvantages of LINQ
  • We cannot use stored procedure in LINQ
  • Writing a complex query is a bit harder
  • Performance degraded if query not written properly
  • We have to build the DDL every time the changes are done in the query.
Faisal Pathan

Faisal Pathan is a founder of TheCodeHubs, .NET Project Manager/Team Leader, and C# Corner MVP. He has extensive experience with designing and developing enterprise-scale applications. He has good skills in ASP.NET C#, ASP.NET Core, ASP.NET MVC, AngularJS, Angular, React, NodeJS, Amazon S3, Web API, EPPlus, Amazon MWS, eBay Integration, SQL, Entity Framework, JavaScript, eCommerce Integration like Walmart, Tanga, Newegg, Group-on Store, etc. and Windows services.

Share
Published by
Faisal Pathan

Recent Posts

Testing hk

Testing

2 years ago

Create and Used PIPE in angular

In this article, we have to show Create and Used PIPE in angular

2 years ago

Operation

Testing

2 years ago

Create and Used PIPE in angular

In this article, we have to show Create and Used PIPE in angular

2 years ago

Create and Used PIPE in angular

In this article, we have to show Create and Used PIPE in angular

2 years ago

TETS NEW

test

3 years ago