In what scenarios is LINQ best applicable?
Would it be good "sense" to suggest to use LINQ to query all kinds of collections?
In what scenarios is LINQ best applicable?
Would it be good "sense" to suggest to use LINQ to query all kinds of collections?
This is a very broad question so I have to provide a very broad answer
LINQ is best applicable in any scenario where you have data represented in an IEnumerable and you must inspect, query, aggregate or project this data in some manner.
Linq is best applicable when you want to query against data.
It runs the gambit from Linq to SQL to Ling to Amazon.
LINQ provides a common syntax for querying datasources - SQL, XML, Objects etc. The underlying provider is responsible for converting your LINQ query to a form appropriate for the datasource, which means all you have to do is 'plugin' the right provider through an interface.You now have nicely separated and consistent code for querying a range of different datasources.