public int Delete(int id) { var role = new Role(); role.Id = id; return(_role.DeleteRole(role)); }
public IActionResult DeleteRole(int id) { try { _roleService.DeleteRole(id); return(Ok()); } catch (Exception ex) { return(BadRequest(new { message = ex.Message })); } }
public HttpResponseMessage Delete(int id) { HttpResponseMessage msg = Request.CreateResponse(HttpStatusCode.BadRequest, false); try { if (id > 0) { var isSuccess = _roleServices.DeleteRole(id); if (isSuccess) { msg = Request.CreateResponse(HttpStatusCode.OK, isSuccess); } } return(msg); } catch (Exception ex) { return(msg); } }
public IHttpActionResult Delete([FromBody] InputDeleteRole input) { var result = _roleServices.DeleteRole(input); return(Ok(result)); }