collections - what is the best linq query for this -


i have collection of calendar objects. calendar has property id.

ienumerable<calendar> calendarstoview; 

i have collection of event objects. event objects have property of calendarid

ienumerable<calendarevent> events; 

i want filter events collection return events calendarid in calendarstoview collection.

what best way of doing this?

do join

var eventsiwant = e in events                   c in calendarstoview                   c.calendarid =  e.calendarid                   select e 

Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -