Only primitive types or enumeration types are supported in this context

My guess is that error indicates that EF cannot translate the equality operator for Employee to SQL (regardless of whether you’re assuming referential equality or an overridden == operator). Assuming the Employee class has a unique identifier try:

var query = from a in db.Activities
            where a.AssignedEmployeeId == currentUser.Id
            where a.IsComplete == false
            orderby a.DueDate
            select a;
return View(query.ToList());

Leave a Comment