public static DefaultAggregateDependencyFactory <TCommandAggregate> ForCommandAggregate <TCommandAggregate>(IConstructAggregates factory = null) where TCommandAggregate : CommandAggregate
        {
            var depFactory = new DefaultAggregateDependencyFactory <TCommandAggregate>(() => CommandAggregateHandler.New <TCommandAggregate>(factory));

            if (factory != null)
            {
                depFactory.AggregateFactoryCreator = () => factory;
            }
            return(depFactory);
        }
 public static void RegisterAggregate <TCommandAggregate>(this IDomainBuilder builder) where TCommandAggregate : CommandAggregate
 {
     builder.RegisterAggregate(DefaultAggregateDependencyFactory.ForCommandAggregate <TCommandAggregate>());
 }