Ejemplo n.º 1
0
        public static IEventFlowOptions AddEntityFrameworkReadModel(this IEventFlowOptions efo)
        {
            var queries = new[] {
                typeof(GetOrderQueryHandler),
                typeof(GetOrdersFromUserQueryHandler)
            };

            return(efo
                   .UseEntityFrameworkReadModel <OrderReadModel, OrderingDbContext>()
                   .UseEntityFrameworkEventStore <OrderingDbContext>()
                   .AddQueryHandlers(queries)
                   .RegisterServices(sr => sr.Register(c => @"Server=tcp:127.0.0.1,5433;Initial Catalog=CapacitacionMicroservicios.OrderingDb;User Id=sa;Password=Pass@word"))
                   .ConfigureEntityFramework(EntityFrameworkConfiguration.New)
                   .AddDbContextProvider <OrderingDbContext, DbContextProvider>());
        }
Ejemplo n.º 2
0
 public static IEventFlowOptions ConfigureForReadStoreIncludeTest(this IEventFlowOptions options)
 {
     return(options
            .UseEntityFrameworkReadModel <PersonReadModelEntity, TestDbContext>(cfg => cfg.Include(x => x.Addresses))
            .AddQueryHandlers(typeof(PersonGetQueryHandler)));
 }
Ejemplo n.º 3
0
 public static IEventFlowOptions IncludeCharges(this IEventFlowOptions eventFlowOptions)
 {
     return(eventFlowOptions.UseEntityFrameworkReadModel <Charge, ApplicationContext>());
 }
 public static IEventFlowOptions IncludeCars(this IEventFlowOptions eventFlowOptions)
 {
     return eventFlowOptions.UseEntityFrameworkReadModel<Car, ApplicationContext>();
 }