Linq filtering an IQueryable<T> (System.Data.Linq.DataQuery) object by a List<T> (System.Collection.
- by Klaptrap
My IQueryable line is:
// find all timesheets for this period - from db so System.Data.Linq.DataQuery
var timesheets = _timesheetRepository.FindByPeriod(dte1, dte2);
My List line is:
// get my team from AD - from active directory so System.Collection.Generic.List
var adUsers = _adUserRepository.GetMyTeam(User.Identity.Name);
I wish to only show timesheets for those users in the timesheet collection that are present in the user collection.
If I use a standard c# expression such as:
var teamsheets = from t in timesheets
join user in adUsers on t.User1.username equals user.fullname
select t;
I get the error "An IQueryable that returns a self-referencing Constant expression is not supported"
Any recommendations?