September 2009 Entries

Returning values from your LINQ queries [quick tip]

Just a quick tip that I found handy while doing some writing yesterday; chances are if you’ve played with LINQ you probably wrote something like this… var outputString = from s in inputString where s.Length > 1 select s; //Do some stuff with outputString in your method... Code like the above will work perfectly well if what you’re going to work with your implicit variable, outputString, within the body of the same method. But, as it stands, you can’t return outputString, or any implicit variable...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Twitter