Пример #1
0
        public IHttpActionResult Put(int id, Cost cost)
        {
            Book bk = bookRepo.AddCost(id, cost);

            if (bk == null)
            {
                return(NotFound());
            }
            return(Ok(bk));
        }
Пример #2
0
        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()));
        }