public static IMapper BuildMapper()
        {
            var configuration = new MapperConfiguration(cfg =>
            {
                CustomerComponentConfiguration.ConfigureMappers(cfg);
                ProductComponentConfiguration.ConfigureMappers(cfg);
                FeatureComponentConfiguration.ConfigureMappers(cfg);
                IncidentComponentConfiguration.ConfigureMappers(cfg);
                JourneyComponentConfiguration.ConfigureMappers(cfg);
                UserComponentConfiguration.ConfigureMappers(cfg);
                SquadComponentConfiguration.ConfigureMappers(cfg);
                MemberComponentConfiguration.ConfigureMappers(cfg);
                SourceComponentConfiguration.ConfigureMappers(cfg);
                SourceItemComponentConfiguration.ConfigureMappers(cfg);
                IndicatorComponentConfiguration.ConfigureMappers(cfg);
                SourceComponent.ConfigureMappers(cfg);
                SecurityRiskComponent.ConfigureMappers(cfg);
                ReliabilityRiskComponent.ConfigureMappers(cfg);
                MigrationComponent.ConfigureMappers(cfg);
            });

            configuration.AssertConfigurationIsValid();
            var mapper = configuration.CreateMapper();

            return(mapper);
        }
 public MigrationComponent(FalconDbContext dbContext,
                           CustomerComponent customerComponent,
                           ProductComponent productComponent,
                           JourneyComponent journeyComponent,
                           FeatureComponent featureComponent,
                           SourceComponent sourceComponent,
                           JourneyMapComponent journeyMapComponent,
                           IndicatorComponent indicatorComponent,
                           SourceItemComponent sourceItemComponent,
                           IncidentComponent incidentComponent,
                           UserComponent userComponent,
                           ProductQueryComponent productQueryComponent,
                           IUserIdentityGateway identityGateway,
                           IDateTimeGateway dateTimeGateway, IMapper mapper,
                           FeatureQueryComponent featureQueryComponent,
                           SecurityRiskComponent securityRiskComponent,
                           ReliabilityRiskComponent reliabilityRiskComponent,
                           SquadComponent squadComponent, SquadQueryComponent squadQueryComponent,
                           ConfigurationComponent configuration) : base(dateTimeGateway, mapper, identityGateway, configuration)
 {
     this._customerComponent        = customerComponent;
     this._sourceComponent          = sourceComponent;
     this._dbContext                = dbContext;
     this._squadComponent           = squadComponent;
     this._squadQueryComponent      = squadQueryComponent;
     this._productComponent         = productComponent;
     this._journeyComponent         = journeyComponent;
     this._featureComponent         = featureComponent;
     this._journeyMapComponent      = journeyMapComponent;
     this._indicatorComponent       = indicatorComponent;
     this._sourceComponent          = sourceComponent;
     this._sourceItemComponent      = sourceItemComponent;
     this._incidentComponent        = incidentComponent;
     this._userComponent            = userComponent;
     this._productQueryComponent    = productQueryComponent;
     this._featureQueryComponent    = featureQueryComponent;
     this._securityRiskComponent    = securityRiskComponent;
     this._reliabilityRiskComponent = reliabilityRiskComponent;
 }
Beispiel #3
0
 public SecurityRiskController(SecurityRiskComponent component)
 {
     _SecurityRiskComponent = component;
 }
        public static void AddApplicationProviders(this IServiceCollection servs, IConfiguration configuration)
        {
            // ASP.NET HttpContext dependency


            // Components


            servs.AddTransient <AppSettingQueryComponent>();
            servs.AddTransient <AppSettingComponent>();

            servs.AddTransient <CustomerQueryComponent>();
            servs.AddTransient <CustomerComponent>();

            servs.AddTransient <ProductQueryComponent>();
            servs.AddTransient <ProductComponent>();


            servs.AddTransient <SourceItemComponent>();
            servs.AddTransient <SourceComponent>();
            servs.AddTransient <IndicatorComponent>();

            servs.AddTransient <FeatureQueryComponent>();
            servs.AddTransient <FeatureComponent>();

            servs.AddTransient <SquadQueryComponent>();
            servs.AddTransient <SquadComponent>();

            servs.AddTransient <JourneyQueryComponent>();
            servs.AddTransient <JourneyComponent>();

            servs.AddTransient <JourneyMapComponent>();

            servs.AddTransient <UserComponent>();
            servs.AddTransient <UserQueryComponent>();

            servs.AddTransient <MemberComponent>();
            servs.AddTransient <MemberQueryComponent>();

            servs.AddTransient <MigrationComponent>();

            servs.AddTransient <IncidentComponent>();

            servs.AddTransient <CacheComponent>();

            servs.AddTransient <ConfigurationComponent>();

            servs.AddTransient <SecurityRiskComponent>();

            servs.AddTransient <ReliabilityRiskComponent>();
            // Gateways
            servs.AddTransient <IDateTimeGateway, DateTimeGateway>();

            // Infra
            servs.AddAspNetCoreIndentityProvider();

            // Automapper
            var mapperCfg = new MapperConfiguration(cfg =>
            {
                CustomerComponentConfiguration.ConfigureMappers(cfg);
                ProductComponentConfiguration.ConfigureMappers(cfg);
                FeatureComponentConfiguration.ConfigureMappers(cfg);
                IncidentComponentConfiguration.ConfigureMappers(cfg);
                JourneyComponentConfiguration.ConfigureMappers(cfg);
                UserComponentConfiguration.ConfigureMappers(cfg);
                SquadComponentConfiguration.ConfigureMappers(cfg);
                MemberComponentConfiguration.ConfigureMappers(cfg);
                SourceComponentConfiguration.ConfigureMappers(cfg);
                SourceItemComponentConfiguration.ConfigureMappers(cfg);
                SquadFeatureComponentConfiguration.ConfigureMappers(cfg);
                IndicatorComponentConfiguration.ConfigureMappers(cfg);
                SourceComponent.ConfigureMappers(cfg);
                SecurityRiskComponent.ConfigureMappers(cfg);
                ReliabilityRiskComponent.ConfigureMappers(cfg);
                MigrationComponent.ConfigureMappers(cfg);
            });

            IMapper mapper = mapperCfg.CreateMapper();

            servs.AddSingleton(mapper);
        }