コード例 #1
0
        public ActionResult Edit(AuthorViewModel model)
        {
            var author = mapper.Map <AuthorViewModel, Author>(model);

            try
            {
                if (ModelState.IsValid)
                {
                    if (authorLogic.Edit(author))
                    {
                        return(RedirectToAction("Index"));
                    }
                }
                return(View(model));
            }
            catch
            {
                return(View(model));
            }
        }
コード例 #2
0
 public bool PutAuthor(Author author)
 {
     return(authors.Edit(author));
 }