示例#1
0
        public IActionResult Delete(int id)
        {
            if (ModelState.IsValid)
            {
                if (_courseRepo.Delete(id))
                {
                    return(new OkResult());
                }
                else
                {
                    return(NoContent());
                }
            }

            return(BadRequest("Invalid Course Model"));
        }
示例#2
0
 public async Task Delete(Course course)
 {
     _repo.Delete(course);
     await _repo.Save();
 }