Ejemplo n.º 1
0
 public static IKitbagBuilder AddInfrastructure(this IKitbagBuilder builder)
 {
     builder.AddEntityFramework<DatabaseContext>();
     builder.AddEntityFrameworkAuditTrail<DatabaseContext>();
     builder.AddUnitOfWork();
    
     builder.AddCQRS();
     builder.AddCQRSIntegrationEvents();
     builder.AddDapperForQueries(new DapperInitializer());
     
     builder.Services.Decorate(typeof(ICommandHandler<>), typeof(UnitOfWorkCommandHandlerDecorator<>));
     builder.Services.Decorate(typeof(ICommandHandler<>), typeof(AuditTrailCommandHandlerDecorator<>));
     
     builder.Services.RegisterRepositories();
     
     //  ServiceBus register event example
     builder.AddServiceBus();
     
     return builder;
 }