Ejemplo n.º 1
0
 public ActionResult Edit(Post post)
 {
     post.CreatedAt = DateTime.Now;
     if (post.TagsRaw != null)
     {
         var split = post.TagsRaw.Split(',');
         post.Tags = split.Select(o => o.Trim()).ToList();
     }
     _postRepository.Update(post);
     return RedirectToAction("Index");
 }
Ejemplo n.º 2
0
 public ActionResult New(Post post)
 {
     post.CreatedAt = DateTime.Now;
     if (post.TagsRaw != null)
     {
         var split = post.TagsRaw.Split(',');
         post.Tags = split.Select(o => o.Trim()).ToList();
     }
     _postRepository.Store(post);
     return RedirectToAction("Post", new {slug = post.Slug});
 }