public async Task <IActionResult> Delete(int id) { var changes = await _recipesService.Delete(id); if (changes == 0) { return(NotFound()); } return(NoContent()); }
public ActionResult <Recipe> Delete(int id) { try { return(Ok(_rs.Delete(id))); } catch (Exception e) { return(BadRequest(e.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 <Recipe> > Delete(int id) { try { Account userInfo = await HttpContext.GetUserInfoAsync <Account>(); _service.Delete(id, userInfo.Id); return(Ok("Deleted")); } catch (System.Exception) { throw; } }
public async Task <ActionResult <Recipe> > Delete(int id) { try { Account userInfo = await HttpContext.GetUserInfoAsync <Account>(); _rService.Delete(id, userInfo.Id); return(Ok("Delorted")); } catch (Exception e) { return(BadRequest(e.Message)); } }
public async Task <ActionResult <Recipe> > 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. _serviceVAR.Delete(id, userInfo.Id); return(Ok("Delorted")); } catch (Exception e) { return(BadRequest(e.Message)); } }
public IActionResult Delete(int id) { RecipesService.Delete(id); return(RedirectToAction("ModifyOverview")); }