Example #1
0
        public void Register(IEventFlowOptions eventFlowOptions)
        {
            // Not sure why this not work
            eventFlowOptions.AddQueryHandlers(typeof(QueryHandlersModule).Assembly);

            eventFlowOptions.RegisterServices(r => { r.Register <BookingQueryHandler, BookingQueryHandler>(); });
        }
 public static IEventFlowOptions ConfigureShippingQueriesInMemory(
     this IEventFlowOptions eventFlowOptions)
 {
     return(eventFlowOptions
            .AddQueryHandlers(Assembly)
            .UseInMemoryReadStoreFor <VoyageReadModel>()
            .UseInMemoryReadStoreFor <CargoReadModel>());
 }
        public static IEventFlowOptions ConfigureReadModels(
            this IEventFlowOptions eventFlowOptions)
        {
            return eventFlowOptions
                .AddQueryHandlers(Assembly)
                .UseMssqlReadModel<AssesmentModuleReadModel>();

        }
        public static IEventFlowOptions AddQueryHandlers(
            this IEventFlowOptions eventFlowOptions,
            Assembly fromAssembly,
            Predicate <Type> predicate = null)
        {
            predicate = predicate ?? (t => true);
            var subscribeSynchronousToTypes = fromAssembly
                                              .GetTypes()
                                              .Where(t => t.GetInterfaces().Any(i => i.IsGenericType && i.GetGenericTypeDefinition() == typeof(IQueryHandler <,>)))
                                              .Where(t => predicate(t));

            return(eventFlowOptions
                   .AddQueryHandlers(subscribeSynchronousToTypes));
        }
Example #5
0
        public static IEventFlowOptions AddQueryHandlers(
            this IEventFlowOptions eventFlowOptions,
            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(eventFlowOptions
                   .AddQueryHandlers(subscribeSynchronousToTypes));
        }
Example #6
0
 public void Register(IEventFlowOptions eventFlowOptions)
 {
     eventFlowOptions.AddQueryHandlers(typeof(ElasticsearchQueryHandlersModule).Assembly);
 }
 public void Register(IEventFlowOptions eventFlowOptions)
 {
     eventFlowOptions.AddQueryHandlers(typeof(EntityFrameworkQueryHandlersModule).Assembly);
 }
 public static IEventFlowOptions AddQueryHandlers(
     this IEventFlowOptions eventFlowOptions,
     params Type[] queryHandlerTypes)
 {
     return(eventFlowOptions.AddQueryHandlers((IEnumerable <Type>)queryHandlerTypes));
 }
 public void Register(IEventFlowOptions eventFlowOptions)
 {
     eventFlowOptions.AddQueryHandlers(typeof(MongoDbQueryHandlersModule).Assembly);
 }
 public static IEventFlowOptions ConfigureBookingQueryHandlers(this IEventFlowOptions eventFlowOptions)
 {
     return(eventFlowOptions
            .AddQueryHandlers(typeof(GetDepartureStationQueryHandler)));
 }