예제 #1
0
        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 }));
     }
 }
예제 #3
0
        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);
            }
        }
예제 #4
0
        public IHttpActionResult Delete([FromBody] InputDeleteRole input)
        {
            var result = _roleServices.DeleteRole(input);

            return(Ok(result));
        }