コード例 #1
0
ファイル: GroupController.cs プロジェクト: ashic/Hermes
        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
ファイル: GroupResource.cs プロジェクト: ashic/Hermes
 public HttpResponseMessage Update(Identity id, Facade.GroupPut group)
 {
     return(ProcessPut(() =>
     {
         var instance = group.ToModel();
         updateGroupCommand.Execute(instance);
     }));
 }