示例#1
0
        public static void ModifyAttribute <TCommand, TTarget, TValue>(this ICommandExecutionContext context, ITypedCommandHandler <TCommand, TTarget> handler, Expression <Func <TTarget, TValue> > propertyExpression, TValue value)
            where TCommand : TypedCommand <TTarget>
        {
            var propertyInfo        = GetPropertyInfo(propertyExpression);
            var attributeDescriptor = AttributeBasedObjectTypeMapping.CreateAttributeDescriptor(propertyInfo);

            context.ModifyAttribute(attributeDescriptor.AttributeName, value);
        }
示例#2
0
 public void Handle(TestingCommand command, ICommandExecutionContext context)
 {
     context.ModifyAttribute(this, x => x.TextProperty, "SomeValue");
 }
示例#3
0
 public void Handle(CreateUnitCommand command, ICommandExecutionContext context)
 {
     context.Create(this);
     context.ModifyAttribute(this, x => x.Name, command.Name);
     context.ModifyAttribute(this, x => x.Address, command.Address);
 }
 public void Handle(MoveUnitCommand command, ICommandExecutionContext context)
 {
     context.ModifyAttribute(this, x => x.Address, command.NewAddress);
 }
 public void Handle(ModifyAttributeCommand command, ICommandExecutionContext context)
 {
     context.ModifyAttribute(command.AttributeName, command.Value);
 }