Exemple #1
0
        public ActionResult Create(BlogPostViewModel viewModel)
        {
            try
            {
                var blogPost = new BlogPost();

                TryUpdateModel(blogPost);

                _blogService.AddBlogPost(blogPost);

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(RedirectToAction("Index"));
            }
        }