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

silverlight - Applying a style to ItemContainerStyle in C# -

c# - NullReferenceException in MySqlClient.NativeDriver -

php - Updating recent updates - Problem in procedure - Any other approach? -