엔티티에 나는 특정 사용자가 속한 모든 그룹을 얻으려고 노력 오전 그룹 도메인 name
, desc
와 모델 (그룹에 속하는) users
의 수집는 Linq에 EF4
있습니다. 내가 쿼리
Cannot compare elements of type 'System.Collections.Generic.ICollection`1'. Only primitive types (such as Int32, String, and Guid) and entity types are supported.
어떤 도움이 appreciated.Thanks 인을 실행하려고 할 때 다음과 같은 오류를 얻을 수
var results = from p in AuthorizationService.UnitOfWork.Groups.FindAll()
where
(p.Users != null && p.Users.Select(u => u.Id).Contains(CurrentUser.Id))
select p.Name;
: 이것은 내 LINQ 문입니다!
마지막으로 포함 된 절을 삭제하고 선택 항목으로 감싸 주시겠습니까? – Rig
리그, 쿼리가 어떻게 생겼는지 보여 줄 수 있습니까? – Lavan