public IActionResult Delete(int id) { if (ModelState.IsValid) { if (_courseRepo.Delete(id)) { return(new OkResult()); } else { return(NoContent()); } } return(BadRequest("Invalid Course Model")); }
public async Task Delete(Course course) { _repo.Delete(course); await _repo.Save(); }