예제 #1
0
        public ActionResult Edit(GroupEditModel model)
        {
            try
            {
                var group = new Group
                {
                    Id          = new Identity(model.Group.Id),
                    Name        = model.Group.Name,
                    Description = model.Group.Description,
                    ParentId    =
                        model.Group.ParentId == null
                                            ? new Identity?()
                                            : new Identity(model.Group.ParentId)
                };

                updateGroupCommand.Execute(group);

                return(RedirectToAction("Index"));
            }
            catch (Exception e)
            {
                ModelState.AddModelError(Guid.NewGuid().ToString(), e);
            }
            model.GroupList = GetGroupList(new Identity(model.Group.Id));
            return(View(model));
        }
예제 #2
0
 public HttpResponseMessage Update(Identity id, Facade.GroupPut group)
 {
     return(ProcessPut(() =>
     {
         var instance = group.ToModel();
         updateGroupCommand.Execute(instance);
     }));
 }