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);
 }
Exemplo n.º 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);
 }
Exemplo n.º 3
0
 public void Handle(TestingCommand command, ICommandExecutionContext context)
 {
     context.Detach(this, x => x.SingleValuedRelation, command.TargetObjectId);
 }
Exemplo n.º 4
0
 private static void DoDetach <TTarget, TValue>(Expression <Func <TTarget, TValue> > propertyExpression, ICommandExecutionContext context, ObjectId refereeId)
 {
     context.Detach(refereeId, GetRelationName(propertyExpression));
 }
Exemplo n.º 5
0
 public void Handle(DetachChildCommand command, ICommandExecutionContext context)
 {
     context.Detach(this, x => x.Children, command.ChildNodeId);
 }