Only primitive types or enumeration types are supported in this context

前端 未结 3 1743
灰色年华
灰色年华 2020-11-27 07:49

I\'ve seen lots of questions on this topic, but I haven\'t been able to sort through any of them that actually solve the issue I\'m seeing. I have an activities entity that

3条回答
  •  臣服心动
    2020-11-27 08:46

    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());
    

提交回复
热议问题