예제 #1
0
        public async Task <StudentVm> GetSudentById(int id)
        {
            Student studentEntity = await _dbContext.Students.SingleAsync(x => x.Id == id);

            StudentVm studentVm = StudentVm.FromEntity(studentEntity);

            return(studentVm);
        }
예제 #2
0
        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);
        }