public async Task <StudentVm> GetSudentById(int id) { Student studentEntity = await _dbContext.Students.SingleAsync(x => x.Id == id); StudentVm studentVm = StudentVm.FromEntity(studentEntity); return(studentVm); }
public async Task <IList <StudentVm> > GetStudentList() { IList <Student> studentEntities = await _dbContext.Students.ToListAsync(); IList <StudentVm> studentVms = studentEntities.Select(x => StudentVm.FromEntity(x)).ToList(); return(studentVms); }