TSQL ‘IN’ Equivalent in LINQ
July 12, 2011 Leave a comment
I needed to create an ‘in’ query in LINQ. After searching around a bit, I came across this post. Very handy:
var q = from l in context.RoadAlert_Location join at in alertTypeIds on l.AlertTypeId equals at select l; foreach (RoadAlert_Location location in q) { locations.Add(MapLocation(location)); }