出错了
考虑到以下内容:
var test = (from ex in DbContext.Exams
where ex.UserId == "123"
select new { }).ToList();
如何将其转换为LINQ的其他样式?
我试过了,但它不适合我:
var test = DbContext.Exams
.GetAll()
.Where(ex => ex.UserId == "123")
.ToList();
GetAll()
删除GetAll
方法:
var test = DbContext.Exams
.Where(ex => ex.UserId == "123")
.ToList();
默认情况下,DbContext.Exams
将返回所有可用Exam
项的IQueryable<Exam>
直接删除.GetAll()
var test = DbContext.Exams
.Where(ex => ex.UserId == "123")
.ToList();