Developer
Developer

Reputation: 18709

In what scenarios is LINQ best applicable?

In what scenarios is LINQ best applicable?

Would it be good "sense" to suggest to use LINQ to query all kinds of collections?

Upvotes: 1

Views: 296

Answers (3)

flesh
flesh

Reputation: 23935

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.

Upvotes: 1

Shane Courtrille
Shane Courtrille

Reputation: 14107

Linq is best applicable when you want to query against data.

It runs the gambit from Linq to SQL to Ling to Amazon.

Upvotes: 1

JaredPar
JaredPar

Reputation: 755587

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.

Upvotes: 7

Related Questions