/// <summary> /// This method deletes a Course /// </summary> /// <param name="Id"></param> /// <returns></returns> public async Task <bool> DeleteCourse(int Id) { bool result = false; if (Id > 0) { var a = await CourseRepository.GetAsync(Id); if (a != null) { try { CourseRepository.DeleteById(a); } catch (Exception ex) { throw ex; } } } return(result); }
public void DeleteCourse(int id) { CourseRepository repository = new CourseRepository(); repository.DeleteById(id); }