Example #1
0
 /// <summary>
 ///     Applies a command to an aggregate.
 /// </summary>
 /// <typeparam name="TAggregate">The type of the aggregate.</typeparam>
 /// <param name="aggregate">The aggregate.</param>
 /// <param name="command">The command.</param>
 /// <returns>The same aggregate with the command applied and any applicable updates performed.</returns>
 public static TAggregate Apply <TAggregate>(
     this TAggregate aggregate,
     ICommand <TAggregate> command)
     where TAggregate : class
 {
     command.ApplyTo(aggregate);
     return(aggregate);
 }