public static IEventFlowOptions AddAggregateRoots( this IEventFlowOptions eventFlowOptions, Assembly fromAssembly, Predicate <Type> predicate = null) { predicate = predicate ?? (t => true); var aggregateRootTypes = fromAssembly .GetTypes() .Where(t => !t.IsAbstract) .Where(t => t.IsClosedTypeOf(typeof(IAggregateRoot <>))) .Where(t => predicate(t)); return(eventFlowOptions.AddAggregateRoots(aggregateRootTypes)); }
public static IEventFlowOptions AddAggregateRoots( this IEventFlowOptions eventFlowOptions, params Type[] aggregateRootTypes) { return(eventFlowOptions.AddAggregateRoots((IEnumerable <Type>)aggregateRootTypes)); }