コード例 #1
0
ファイル: BlogController.cs プロジェクト: sharonrussell/Blog
        public ActionResult AddBlog(BlogViewModel model)
        {
            BlogDto blog = new BlogDto
            {
                Author = model.Author
            };

            _service.AddBlog(blog);

            return RedirectToAction("Index", "Home");
        }
コード例 #2
0
ファイル: BlogService.cs プロジェクト: sharonrussell/Blog
        public void AddBlog(BlogDto blogDto)
        {
            Blog blog = new Blog(blogDto.Author);

            _blogRepository.AddBlog(blog);
        }