public IActionResult Index() { var viewModel = new StudentsStudentsIndexViewModel(); var a = repository.GetAllForTable(); viewModel.Students = repository.GetAllForTable().Select(s => new StudentForTable() { First = s.First, Middle = s.Middle, Last = s.Last, Id = s.StudentId, }).ToList(); return(View(viewModel)); }