Exemplo n.º 1
0
        public async Task <IActionResult> FindStudentsAsync(string sku)
        {
            try
            {
                var students = await _studentsRepository.FindStudentsAsync(sku);

                if (students != null)
                {
                    return(new OkObjectResult(students.Select(p => new StudentViewModel
                    {
                        //Id = p.StudentId,

                        Name = p.Name.Trim(),
                        Gender = p.Gender.Trim(),
                        SchoolId = p.School
                    }
                                                              )));
                }
                return(new NotFoundResult());
            }
            catch
            {
                return(new ConflictResult());
            }
        }