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}); }
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"); }