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