我有一个群组域模型 name
,desc
和收集 users
(属于该组)
我正在尝试获取特定用户所属的所有组。这是我的LinQ声明:
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;
我尝试执行查询时收到以下错误
Cannot compare elements of type 'System.Collections.Generic.ICollection`1'. Only primitive types (such as Int32, String, and Guid) and entity types are supported.
任何帮助表示赞赏。谢谢!