如何在 ViewModel 中填充列表集合
控制器:
SchoolEntities db = new SchoolEntities();
public ActionResult Index()
{
var student= from s in db.Students
select s.Name.ToList();
return View();
}
模型视图:
public List<Student>students { get; set;}