Home  /  Questions  /  Question

61   95.6
Oct 05, 2010

When to use LINQ in code?

When it is advisable to use LINQ in code?

1,128   99.9
Oct 05, 2010

340   99.9
Oct 23, 2010

Question is very broad....

See this is where you should thinks on LINQ

1. LINQ to SQL

        When the queries and sub queries are more more costlier and has expensive bussines logic in the joins. get the row data to         framwork layer and by using LINQ to SQL to the required data. This is the case mostly in Reporting or Reports development.

2. LINQ to Objects

        When it comes to implement custom Enumerables and Enumerators it is best to use LINQ to Objects. Because LINQ is         developed on these interfaces.

3. LINQ to XML

        It is bit strait forward. it is more user frendly then System.XML namspace to read XML data.

Hope this gives good starting point.