1

What are the effects of Linq on an application rather than SQL queries?

Is there is any issue in using Linq in case of large amount of data for a long time of period?

What are the behavioral key difference between both?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Thrainder
  • 77
  • 1
  • 10
  • 1
    `LINQ` is the interface between database entities (tables) and code entities (classes). I'm sure you can find many many explanations online about the differences – Nick.Mc Jul 29 '19 at 07:12
  • My main reason for using Linq instead of SQL queries is that I don't want to write hard-coded SQL queries. When you change structure on the database, you need to update all queries depending on that change. In short, 'LINQ' helps you to manage the connection between code and database. Better search on the net. – Tunahan Jul 29 '19 at 08:10
  • If you add or remove a column to your table you have to change your LINQ. If you change database structure you definitley have to change your LINQ. – Nick.Mc Jul 29 '19 at 11:05
  • 2
    Linq (in general) and SQL are not directly comparable. You can't query your database with [Linq to Objects](https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/linq/linq-to-objects) for example. – Theodor Zoulias Jul 29 '19 at 14:22
  • Ah yes you're correct - LINQ is far more than just a database access layer. – Nick.Mc Jul 30 '19 at 08:05
  • Is there is any negative point in LINQ for large amount of data. – Thrainder Jul 31 '19 at 05:03
  • The only negative point is that you may heave less control over it for tuning purposes if you run into particularly strange and specific performance issues – Nick.Mc Aug 06 '19 at 11:11

1 Answers1

1

Simple advantages

  • Creating in-memory collections
  • for a number of situations it would be easier to read and write. (note there are some queries that would make more sense in SQL)
  • Allows you to call C# functionality that you create or from the .net framework to interact with your data.
  • In some cases it is easier to debug.

For a more in depth and correct answer go to Learning about LINQ

Neil
  • 641
  • 1
  • 7
  • 21