public static IEventFlowOptions AddJobs(this IEventFlowOptions eventFlowOptions, Assembly fromAssembly, Predicate <Type> predicate = null) { predicate = predicate ?? (t => true); var jobTypes = fromAssembly .GetTypes() .Where(t => t.GetInterfaces().Any(i => i == typeof(IJob))) .Where(t => predicate(t)); return(eventFlowOptions.AddJobs(jobTypes)); }
public static IEventFlowOptions AddJobs( this IEventFlowOptions eventFlowOptions, Assembly fromAssembly, Predicate <Type> predicate) { predicate = predicate ?? (t => true); var jobTypes = fromAssembly .GetTypes() .Where(t => !t.IsAbstract && typeof(IJob).IsAssignableFrom(t)) .Where(t => predicate(t)); return(eventFlowOptions.AddJobs(jobTypes)); }
public static IEventFlowOptions AddJobs( this IEventFlowOptions eventFlowOptions, Assembly fromAssembly, Predicate <Type> predicate = null) { predicate = predicate ?? (t => true); var jobTypes = fromAssembly .GetTypes() .Where(type => !type.GetTypeInfo().IsAbstract&& type.IsAssignableTo <IJob>()) .Where(t => !t.HasConstructorParameterOfType(i => i.IsAssignableTo <IJob>())) .Where(t => predicate(t)); return(eventFlowOptions.AddJobs(jobTypes)); }
public void Register(IEventFlowOptions eventFlowOptions) { // Use explicit adding of types, no need to scan assembly eventFlowOptions.AddJobs( typeof(PublishCommandJob), typeof(DispatchToAsynchronousEventSubscribersJob)); }
public static IEventFlowOptions AddJobs( this IEventFlowOptions eventFlowOptions, params Type[] jobTypes) { return(eventFlowOptions.AddJobs(jobTypes)); }
public void Register(IEventFlowOptions eventFlowOptions) { // Use explicite adding of types, no need to scan assembly eventFlowOptions.AddJobs( typeof(PublishCommandJob)); }
public void Register(IEventFlowOptions eventFlowOptions) { // Use explicite adding of types, no need to scan assembly eventFlowOptions.AddJobs( typeof (PublishCommandJob)); }