我正在努力确保为所有用户分配了特定角色.是否有任何视图或SQL查询来获取此信息?
我有一个类似下面的架构(这是一个简化的示例,所以请忽略明显的架构问题):
table Books
{
string bookId
}
table students_books
{
string studentname
string bookId
}
Run Code Online (Sandbox Code Playgroud)
目的是找出阅读量少于500次的书籍.不幸的是,我无法在书桌上保留这一数字.
我正在编写这样的查询:
from book in Books
where !(from student in students_books
group student by student.bookId into GroupedPerStudent
where GroupedPerStudent.Count() >= 500
select new { bookname = GroupedPerStudent.Key }).Contains(book.bookid)
select book
Run Code Online (Sandbox Code Playgroud)
我收到了编译错误Contains().查询有什么问题?
无法从用法推断出方法'System.Linq.Enumerable.Contains <TSource>(System.Collections.Generic.IEnumerable <TSource>,TSource)'的类型参数.尝试显式指定类型参数.