public ActionResult Update(Guid id) { var post = service.Leer().First(g => g.PostId == id); var puv = new PostUpdateView() { Id = post.PostId, Texto = post.Texto, Tipo = post.PostType, Titulo = post.Titulo }; return(View(puv)); }
public ActionResult Update(Guid id, PostUpdateView post) { if (ModelState.IsValid) { Post postForService = new Post() { PostId = post.Id, Titulo = post.Titulo, Texto = post.Texto, PostType = post.Tipo }; service.Update(postForService); } return(View(post)); }