public static IDomainContainer AddSubscribers( this IDomainContainer domainContainer, Assembly fromAssembly, Predicate <Type> predicate = null) { predicate = predicate ?? (t => true); var types = fromAssembly .GetTypes() .Where(t => t.GetTypeInfo().GetInterfaces().Any(IsSubscriberInterface)) .Where(t => !t.HasConstructorParameterOfType(IsSubscriberInterface)) .Where(t => predicate(t)); return(domainContainer.AddSubscribers(types)); }
public static IDomainContainer AddSubscribers( this IDomainContainer domainContainer, params Type[] types) { return(domainContainer.AddSubscribers((IEnumerable <Type>)types)); }