public void Handle(SetParentCommand command, ICommandExecutionContext context)
 {
     foreach (var formerParentId in context.GetRelated(this, x => x.Parent))
     {
         context.Detach(this, x => x.Parent, formerParentId);
     }
     context.Attach(this, x => x.Parent, command.ParentNodeId);
 }
예제 #2
0
 public void Handle(SetHierarchyRootCommand command, ICommandExecutionContext context)
 {
     foreach (var formerRootId in context.GetRelated(this, x => x.RootNode))
     {
         context.Detach(this, x => x.RootNode, formerRootId);
     }
     context.Attach(this, x => x.RootNode, command.NodeId);
 }
예제 #3
0
 public void Handle(AttachToHierarchyCommand command, ICommandExecutionContext context)
 {
     context.Attach(this, x => x.Nodes, command.NodeId);
 }
예제 #4
0
 public void Handle(TestingCommand command, ICommandExecutionContext context)
 {
     context.Attach(this, x => x.SingleValuedRelation, command.TargetObjectId);
 }
 public void Handle(AttachChildCommand command, ICommandExecutionContext context)
 {
     context.Attach(this, x => x.Children, command.ChildNodeId);
 }
 public void Handle(AttachObjectCommand command, ICommandExecutionContext context)
 {
     context.Attach(command.RefereeObjectId, command.RelationName);
 }
예제 #7
0
 private static void DoAttach <TTarget, TValue>(Expression <Func <TTarget, TValue> > propertyExpression, ICommandExecutionContext context, ObjectId refereeId)
 {
     context.Attach(refereeId, GetRelationName(propertyExpression));
 }
예제 #8
0
 public void Handle(CreateHierarchyNodeCommand command, ICommandExecutionContext context)
 {
     context.Create(this);
     context.Attach(this, x => x.Unit, command.UnitId);
     context.Attach(this, x => x.Context, command.HierarchyId);
 }