public IActionResult DeleteCourse(int EnrollId) { var DelEnroll = _EnrollRepository.GetEnrollment(EnrollId); if (DelEnroll != null) { _EnrollRepository.DeleteEnrollment(DelEnroll); return(Ok()); } return(NotFound($"There is no record found with this Id:{EnrollId}")); }
public async Task <ActionResult> Delete( int id, int orgId, int siteId, Enrollment enrollment ) { if (enrollment.Id != id) { return(BadRequest()); } try { _enrollments.DeleteEnrollment(enrollment); await _enrollments.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { return(NotFound()); } return(Ok()); }
/// <summary> /// /// </summary> /// <param name="id"></param> /// <returns></returns> public IActionResult DeleteEnrollment(int id) { _EnrollmentRepository.DeleteEnrollment(id); return(RedirectToAction("Index", "Home")); }
public string DeleteEnrollment(int id) { var enrollments = enrollmentRepository.DeleteEnrollment(id); return(enrollments); }