班级
public class Employee
{
public string EmployeeID { get; set; }
public string Surname { get; set; }
public string FirstName { get; set; }
public bool Employed { get; set; }
public bool Administrator { get; set; }
}
Linq 语句
var adminlist = db.Employees.Where(x => x.Administrator).Select(x => x.Administrator).ToList();
我确定这是一个愚蠢的问题,但请谁能告诉我为什么上面返回 null ?我也试过这个:
var adminlist = db.Employees.Where(x => x.Administrator).ToList();