I have searched for this, but still can\'t seem to get this to work for me. I have an array of Id\'s associated with a user (their Organization Id). These are placed in an
It would be something like this, OrgIds.ToList.Contains(p.OrginizationID)
Though really I would do it more like this:
var OrgIds = (from oh in this.Database.OrganizationsHierarchies
join o in this.Database.Organizations on oh.OrganizationsId equals o.Id
where (oh.Hierarchy.Contains(@OrgId))
|| (oh.OrganizationsId == Id)
select o.Id);
List query = (from p in this.Database.Personnels
where (OrgIds.Contains(p.OrigizationID)
select p).ToList();
That way the final query to get personnel will execute containing the combined query from both.