public ActionResult <Ingredient> 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(_ingredientsService.Delete(id))); } catch (System.Exception err) { return(BadRequest(err.Message)); } }
public ActionResult <string> Delete(int id) { try { _service.Delete(id); return(Ok("deleted")); } catch (System.Exception e) { return(BadRequest(e.Message)); } }
public async Task <ActionResult <Ingredient> > Delete(int id) { try { // TODO[epic=Auth] Get the user info to set the creatorID Account userInfo = await HttpContext.GetUserInfoAsync <Account>(); // safety to make sure an account exists for that user before CREATE-ing stuff. _service.Delete(id, userInfo.Id); return(Ok("Delorted")); } catch (Exception e) { return(BadRequest(e.Message)); } }