Example #1
0
 public ActionResult Edit(BlogSiteViewModel view)
 {
     string errorMessage = _blogSiteService.SaveBlog(view);
     if (string.IsNullOrEmpty(errorMessage))
         return RedirectToActionPermanent("Index");
     view.ErrorMessage = errorMessage;
     return View(view);
 }
 public Blog MapToEntity(BlogSiteViewModel view)
 {
     var entity = Mapper.Map<BlogSiteViewModel, Blog>(view);
     return entity;
 }
Example #3
0
 public string SaveBlog(BlogSiteViewModel view)
 {
     Blog blog = _mappingService.MapToEntity(view);
     return _blogSiteRepository.Save(blog);
 }
Example #4
0
 public ActionResult Create()
 {
     var viewModel = new BlogSiteViewModel();
     return View(viewModel);
 }