IamCalvinBrown.com a Blog Site

Code Examples, Consulting Advice and lots of other cool things

How to query using linq to objects in .net

Want to query a collection without writing a loop in .NET? Here's a linq expression, and the sample code to help.

// our custom object of data

int[] listOfNumbers = { 12345678910 };

 // use LINQ to get all even numbers

    var result = from number in listOfNumbers
        where (number % 2) == 0
         select number;


To download the sample project, please visit http://bit.ly/2vGZriL

Comments (1) -

  • TypKPTA0b7JE

    11/21/2017 4:37:38 PM |

    842341 693785I require to admit that that is one fantastic insight. It surely gives a company the opportunity to have in around the ground floor and truly take part in generating a thing special and tailored to their needs. 179784

Loading