Ejemplo n.º 1
0
        public async Task <IActionResult> DeleteStudentAsync(int studentId)
        {
            try
            {
                var student = await _studentsRepository.DeleteStudentAsync(studentId);

                if (student != null)
                {
                    return(new OkObjectResult(new StudentViewModel
                    {
                        // Id = student.StudentId,
                        Gender = student.Gender.Trim(),
                        Name = student.Name.Trim(),
                        SchoolId = student.School
                    }));
                }
                return(new NotFoundResult());
            }
            catch
            {
                return(new ConflictResult());
            }
        }
Ejemplo n.º 2
0
        public async Task <ActionResult> Delete(Guid id)
        {
            await _repository.DeleteStudentAsync(id);

            return(Ok());
        }