コード例 #1
0
        public IActionResult Update(int id)
        {
            var result = _personListClient.Get(new GetPersonQuery {
                Id = id
            });

            return(View(FormModel.FromModel(result.Person)));
        }
コード例 #2
0
        public IActionResult Update(FormModel <Person> form)
        {
            try
            {
                _personListClient.Put(new UpdatePersonCommand {
                    Person = form.Data
                });
            }
            catch (ValidationException e)
            {
                return(View(FormModel.FromModel(form.Data, e)));
            }

            return(Redirect("/"));
        }
コード例 #3
0
 public IActionResult Add()
 {
     return(View("Update", FormModel.FromModel(new Person())));
 }