示例#1
0
        public async Task <List <StudentDto> > GetStudents()
        {
            var students = await _studentsRepository.FindAllAsync(p => true);

            var result = students.Select(p => new StudentDto
            {
                Id   = p.Id,
                Name = p.Name,
                Age  = p.Age
            }).ToList();

            return(result);
        }