Ejemplo n.º 1
0
        public ActionResult Edit(Models.PostNewModel collection)
        {
            var post = postService.Get(collection.Id);

            post.Text = collection.Text;
            postService.Update(post);
            return(RedirectToAction("Index", "Home"));
        }
Ejemplo n.º 2
0
        public ActionResult Edit(int id)
        {
            var postEntity = postService.Get(id);
            var postModel  = new Models.PostNewModel()
            {
                Id = postEntity.Id, Text = postEntity.Text
            };

            return(View(postModel));
        }