public ActionResult Edit(PostInput input)
{
if (!ModelState.IsValid)
return View("Edit", input);
var post = DbContext.Posts.Single(p => p.Id == input.Id);
if (TryUpdateModel(post, "", null, new string[]{"Tags"}))
{
post.DateModified = DateTime.Now;
_tagService.UpdateTag(DbContext, input, post);
DbContext.Entry(post).State = System.Data.EntityState.Modified;
DbContext.SaveChanges();
return RedirectToAction("Detail", "Post", new { id = input.Id });
}
return View("Edit", input);
}