Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 9th, 2012  |  syntax: None  |  size: 0.55 KB  |  hits: 6  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Is it possible to use a LINQ Query in Windows Workflow rule condition?
  2. private static void ShowQueryWithCode(IEnumerable<string> names)
  3. {
  4.     Console.WriteLine("LINQ Query in Code - show names that start with 'R'");
  5.  
  6.     // Assuming there are no null entries in the names collection
  7.     var query = from name in names where name.StartsWith("R") select name;
  8.  
  9.     // This is the same thing as
  10.     // var query = names.Where(name => name.StartsWith("R"));
  11.     foreach (var name in query)
  12.     {
  13.         Console.WriteLine(name);
  14.     }
  15.  
  16.     Console.WriteLine();
  17. }