Beispiel #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;
 }
Beispiel #3
0
 public string SaveBlog(BlogSiteViewModel view)
 {
     Blog blog = _mappingService.MapToEntity(view);
     return _blogSiteRepository.Save(blog);
 }
Beispiel #4
0
 public ActionResult Create()
 {
     var viewModel = new BlogSiteViewModel();
     return View(viewModel);
 }