I have Employees, Groups, and EmployeeGroupFilters.
An Employee has a GroupID with foreign key relationship.
An EmployeeGroupFilter has an Employee and Group ID. Each employee can filter which groups they do not want to see in the calendar.
Thus, if an EmployeeGroupFilter exists, that employee will not see that group.
I need a query that will return an IEnumerable of Group which will be the groups that are VISIBLE to the employee.
Ex: select all from Groups where group not in currentEmployee's Group filters.
Right now I can get all the employees filters like this:
public static IEnumerable<EmployeGroupFilter> GetAllByEmployee(
int employeeID)
{
KezberPMDBDataContext db = new KezberPMDBDataContext();
return from p in db.EmployeGroupFilters
where p.EmployeID == employeeID
select p;
}
I need something like:
public static IEnumerable<Group> GetAllVisibleEmployeeGroups(
int employeeID)
{
KezberPMDBDataContext db = new KezberPMDBDataContext();
return from p in db.Groups
.......
select p;
}