How do I tell the cases when it's worth to use LINQ?

Posted by Lijo on Programmers See other posts from Programmers or by Lijo
Published on 2012-08-02T15:29:49Z Indexed on 2012/11/02 11:17 UTC
Read the original article Hit count: 326

Filed under:
|
|
|

Many things in LINQ can be accomplished without the library. But for some scenarios, LINQ is most appropriate.

Examples are:

  1. SELECT - http://stackoverflow.com/questions/11883262/wrapping-list-items-inside-div-in-a-repeater
  2. SelectMany, Contains - http://stackoverflow.com/questions/11778979/better-code-pattern-for-checking-existence-of-value
  3. Enumerable.Range - http://stackoverflow.com/questions/11780128/scalable-c-sharp-code-for-creating-array-from-config-file
  4. WHERE http://stackoverflow.com/questions/13171850/trim-string-if-a-string-ends-with-a-specific-word

What factors to take into account when deciding between LINQ and regular .Net language elements?

© Programmers or respective owner

Related posts about c#

Related posts about .NET