LINQ: SELECT WHERE ITEM IN (“A”,”B”, “C”)

 

Code Snippet
  1. if (logs != null && logs.Count() > 0)
  2.           {
  3.  
  4.               List<IQueryable<EventRecord>> list = new List<IQueryable<EventRecord>>();
  5.  
  6.               foreach (string log in logs)
  7.               {
  8.                   string logName = log;
  9.                   list.Add(eventResults.Where(x => x.LogName == logName));
  10.               }
  11.  
  12.               int i = 0;
  13.               foreach (var item in list)
  14.               {
  15.                   if (i == 0)
  16.                       eventResults = item;
  17.                   else
  18.                       eventResults = eventResults.Concat(item);
  19.                   i++;
  20.               }
  21.  
  22.           }

Advertisements

About vijayvepa

I'm a software consultant for Software Specialists Inc. currently working at Philips Respironics, Pittsburgh

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: