Example #1
0
 public ActionResult <string> Delete(int id)
 {
     try
     {
         return(Ok(_contractorsService.Delete(id)));
     }
     catch (System.Exception err)
     {
         return(BadRequest(err.Message));
     }
 }
 public ActionResult <Contractor> Delete(int id)
 {
     try
     {
         return(Ok(_service.Delete(id)));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }
 public ActionResult <string> Delete(int id)
 {
     try
     {
         return(Ok(_cs.Delete(id)));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }
Example #4
0
 public ActionResult <Contractor> Delete(int id)
 {
     try
     {
         return(Ok(_serv.Delete(id)));
     }
     catch (System.Exception err)
     {
         return(BadRequest(err.Message));
     }
 }
Example #5
0
 public ActionResult <bool> Delete(int id)
 {
     try
     {
         return(Ok(_service.Delete(id)));
     }
     catch (System.Exception error)
     {
         return(BadRequest(error.Message));
     }
 }
Example #6
0
        public async Task <ActionResult <Contractor> > Delete(int id)
        {
            try
            {
                Profile userInfo = await HttpContext.GetUserInfoAsync <Profile>();

                return(Ok(_service.Delete(id, userInfo.Id)));
            }
            catch (Exception e)
            {
                return(BadRequest(e.Message));
            }
        }
        public async Task <ActionResult <Contractor> > Delete(int id)
        {
            try
            {
                Profile userInfo = await HttpContext.GetUserInfoAsync <Profile>();

                //NOTE send userinfo.id so you can validate they are the creator of the original

                return(Ok(_service.Delete(id, userInfo.Id)));
            }
            catch (Exception e)
            {
                return(BadRequest(e.Message));
            }
        }