Exemplo n.º 1
0
 //
 // GET: /User/Edit/5
 public ActionResult Edit(string id)
 {
     var vm = new EditUserViewModel
     {
         Name = this.userService.GetUser(id).Name
     };
     return View(vm);
 }
Exemplo n.º 2
0
 public ActionResult Edit(string id, EditUserViewModel model)
 {
     if (ModelState.IsValid)
     {
         var command = new EditUserCommand { Name = model.Name, ID = id };
         this.invoker.Execute(command);
         return RedirectToAction("Index");
     }
     return View(model);
 }