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()); } }
public async Task <ActionResult> Delete(Guid id) { await _repository.DeleteStudentAsync(id); return(Ok()); }