BookManager.Web.Controllers.AdminController.EditBook C# (CSharp) Метод

EditBook() приватный Метод

private EditBook ( [ Include = "BookId,Title,Author,ReleaseDate,Description,Cost,ImagePath")]Bookbook, System.Web.HttpPostedFileBase ImageBrowse ) : System.Web.Mvc.ActionResult
Include [
ImageBrowse System.Web.HttpPostedFileBase
Результат System.Web.Mvc.ActionResult
        public ActionResult EditBook([Bind(Include = "BookId,Title,Author,ReleaseDate,Description,Cost,ImagePath")] Book book, HttpPostedFileBase ImageBrowse)
        {
            if (ModelState.IsValid)
            {
                db.Entry(book).State = EntityState.Modified;
                if (ImageBrowse != null && ImageBrowse.ContentLength > 0)
                {
                    var pic = book.BookId + ".jpg";
                    var path = System.IO.Path.Combine(
                                           Server.MapPath("~/Content/Images/Covers"), pic);
                    ImageBrowse.SaveAs(path);
                    book.ImagePath = pic;
                }
                db.SaveChanges();

                var categories = db.Categories.ToList();
                List<Genre> newCategories = new List<Genre>();
                foreach (var category in categories)
                {
                    if (Request["Category" + category.GenreId] != "false")
                    {
                        newCategories.Add(category);
                    }
                }

                UpdateBookCategory(book.BookId, newCategories);
                return RedirectToAction("Books");
            }
            return View(book);
        }

Same methods

AdminController::EditBook ( int id ) : System.Web.Mvc.ActionResult