Getting started with Linq

Linq enables a developer to query any data source without having the knowledge of internal architecture, confused right? this means, if you need to query databases, SQL is mandatory likewise if you need to query XML you will have to know XPath, but linq removes such load from your shoulder and allow you to write queries in one language which is very similar to SQL for any data source and it will take care of the rest

If you have to query a SQL Server database then you will have to know the SQL language, similarly for Oracle database, Pl/SQL becomes necessary, likewise we need to learn different types of languages to query different data sources, but LINQ provides us a uniform query syntax for all data sources, we just learn LINQ and we can query any data source.

Actually, Linq has several providers, we call them LINQ providers, we write queries using LINQ extension methods or operators and the LINQ provider converts our query to data source specific language, for example, it is the duty of Linq-to-SQL LINQ provider to convert our query to corresponding T-SQL.

In this course we will learn each and every concept of Linq with a number of examples, so go through each article and start learning Linq today

Don't be afraid of Linq, if you have an idea of c# language then learning LINQ is a piece of cake, all Linq operators are just extension methods that expect a delegate, being a c# developer you should know that a delegate can point to any function of the same signature, so we can create functions and pass them as parameters to Linq extension methods or we can create inline functions using lambda expressions, so we actually pass lambda expressions to Linq extension methods.

Welcome to the journey of becoming Linq expert,if you are a beginner and really want to be a professional, then follow the below steps:-

  • Go through each article one by one without skipping any of them.
  • Try to implement and practice what you have learnt in the article by yourself.
  • Use your imagination and thinking power and ask these questions to yourself:-
    • Why did i read this article?
    • What i learned after reading this article?
    • Should i open visual studio and try to implement something?
    • Am i getting errors?ok ,which type of error
      • Is it compilation error?
      • Is it Run time error?
      • Can i solve this myself?
      • Can my friends solve this problem?
      • Should i ask this question on Stackoverflow?