Beispiel #1
0
        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));
        }
Beispiel #2
0
 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));
 }