public async Task <IActionResult> Delete(long Id) { var result = await _instructorService.DeleteInstructor(Id); var response = new APIResponse <bool>(result); return(Ok(response)); }
public IHttpActionResult DeleteInstructor([FromUri] int instructorId, [FromUri] long groupId) { var instructorGroup = new InstructorGroupEntity { GroupId = groupId, InstructorId = instructorId }; instructorService.DeleteInstructor(instructorGroup); return(Ok()); }
public IActionResult DeleteInstructor([FromQuery] int instructorId) { try { _instructorService.DeleteInstructor(instructorId); return(Ok()); } catch (Exception ex) { return(BadRequest(ex.Message)); } }
public IActionResult DeleteInstructor(int id) { try { _instructorService.DeleteInstructor(id); ViewData["Message"] = "Instructor Deleted"; return(View("Message")); } catch (Exception e) { ViewData["Message"] = e.Message; return(View("Message")); } }
public ActionResult DeleteConfirmed(int id) { _instructorService.DeleteInstructor(id); return(RedirectToAction("Index")); }