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); }
public void Handle(TestingCommand command, ICommandExecutionContext context) { context.ModifyAttribute(this, x => x.TextProperty, "SomeValue"); }
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); }