public IHttpActionResult Put(int id, Cost cost) { Book bk = bookRepo.AddCost(id, cost); if (bk == null) { return(NotFound()); } return(Ok(bk)); }
public ActionResult AddCost(Cost cost) { var bookid = Convert.ToInt32(Request["Id"]); Book book = bookrepo.AddCost(bookid, cost); if (book == null) { return(HttpNotFound()); } return(Redirect(Request.UrlReferrer.ToString())); }