Exemple #1
0
        public void Start()
        {
            LogConfigurator.ConfigureForService();

            Log.Information("Viaduc service is starting");

            var containerBuilder = ContainerConfigurator.Configure();

            BusConfigurator.ConfigureBus(containerBuilder, MonitoredServices.ViaducService, (cfg, ctx) =>
            {
                cfg.ReceiveEndpoint(BusConstants.ReadUserInformationQueue,
                                    ec => { ec.Consumer(ctx.Resolve <ReadUserInformationConsumer>); }
                                    );
                cfg.ReceiveEndpoint(BusConstants.ReadStammdatenQueue,
                                    ec => { ec.Consumer(ctx.Resolve <ReadStammdatenConsumer>); }
                                    );
            });

            var container = containerBuilder.Build();

            bus = container.Resolve <IBusControl>();
            bus.Start();

            Log.Information("Viaduc service started");
        }
Exemple #2
0
        static async Task <int> Main(string[] args)
        {
            Console.WriteLine("Starting Application");

            var cts = new CancellationTokenSource();

            AppDomain.CurrentDomain.ProcessExit += (s, e) =>
            {
                cts.Cancel();
            };

            var serviceCollection = new ServiceCollection();

            var configuration = OptionsConfigurator.Configure(serviceCollection);

            LoggingConfiguration.Configure(serviceCollection, configuration);

            var serviceProvider = ContainerConfigurator.Configure(serviceCollection);

            var application = serviceProvider.GetService <Application.Application>();

            application.Start();

            await Task.Delay(-1, cts.Token);

            Console.WriteLine("Closing application");
            return(0);
        }
Exemple #3
0
        public OrderService()
        {
            // Configure IoC Container
            kernel = ContainerConfigurator.Configure();
            LogConfigurator.ConfigureForService();

            recalcTermineListener = new RecalcTermineListener(kernel.Get <IOrderDataAccess>());
        }
Exemple #4
0
        static Program()
        {
            ContainerConfigurator.Configure(builder =>
            {
                DependencyContainer.Builder(builder);
            });

            PriceEngineService = ServiceLocator.GetInstance <IPriceEngineService>();
        }
        public void Configuration(IAppBuilder app)
        {
            var builder = ContainerConfigurator.Configure();

            var config = new HttpConfiguration();

            config.Formatters.Insert(0, new DigitalisierungsAuftragFormatter());
            config
            .EnableSwagger(c => c.SingleApiVersion("v1", "Vecteur API"))
            .EnableSwaggerUi(c => { c.EnableApiKeySupport("X-ApiKey", "header"); });

            config.MapHttpAttributeRoutes();
            config.Services.Add(typeof(IExceptionLogger), new VecteurExceptionLogger());
            builder.RegisterApiControllers(Assembly.GetExecutingAssembly());

            container = builder.Build();
            config.DependencyResolver = new AutofacWebApiDependencyResolver(container);

            app
            .UseSwagger(typeof(Startup).Assembly, c =>
            {
                c.PostProcess = document =>
                {
                    document.Info.Title       = "Vecteur API";
                    document.Info.Version     = "v1";
                    document.Info.Description = "API um Aufträge aus Viaduc zu verarbeiten.";
                    document.SecurityDefinitions.Add("ApiKey", new SwaggerSecurityScheme
                    {
                        Type        = SwaggerSecuritySchemeType.ApiKey,
                        Scheme      = "X-ApiKey",
                        In          = SwaggerSecurityApiKeyLocation.Header,
                        Name        = "X-ApiKey",
                        Description = "API key for request authorization."
                    });
                    document.Produces = new List <string> {
                        "application/xml", "application/json"
                    };
                    document.Consumes = new List <string> {
                        "application/xml", "application/json"
                    };
                };
            })
            .UseSwaggerUi3(typeof(Startup).Assembly, c =>
            {
                c.GeneratorSettings.DocumentProcessors.Add(
                    new SecurityDefinitionAppender("ApiKey", new SwaggerSecurityScheme
                {
                    Type = SwaggerSecuritySchemeType.ApiKey,
                    Name = "X-ApiKey",
                    In   = SwaggerSecurityApiKeyLocation.Header
                }));
                c.GeneratorSettings.OperationProcessors.Add(new OperationSecurityScopeProcessor("ApiKey"));
            })
            .UseAutofacMiddleware(container)
            .UseAutofacWebApi(config)
            .UseWebApi(config);
        }
        static void Main(string[] args)
        {
            var container = new UnityContainer();

            ContainerConfigurator.Configure(container, System.Configuration.ConfigurationManager.ConnectionStrings["Default"].ConnectionString);

            var server = new Server(container);

            server.Start(12321);
        }
Exemple #7
0
        internal static ISchemaProvider Create(ISchemaOptions schemaOptions)
        {
            ArgumentUtility.CheckNotNull("schemaOptions", schemaOptions);
            ArgumentUtility.CheckNotNull("schemaOptions.Database", schemaOptions.Database);
            ArgumentUtility.CheckNotNullOrEmpty("schemaOptions.ConnectionString", schemaOptions.ConnectionString);

            var container = new UnityContainer();

            ContainerConfigurator.Configure(container, schemaOptions);

            return(container.Resolve <ISchemaProvider>());
        }
 protected DatabaseOrientedTest()
 {
     ContainerConfigurator.Configure(builder =>
     {
         DependencyContainer.Builder(builder);
         builder.RegisterAssemblyTypes(Assembly.GetExecutingAssembly())
         .Where(x => x.GetInterfaces().Any(i => i.IsGenericType && i.GetGenericTypeDefinition() == typeof(IFactory <>)))
         .AsImplementedInterfaces();
     });
     _dataContext       = ServiceLocator.GetInstance <StnContext>();
     PriceEngineService = ServiceLocator.GetInstance <IPriceEngineService>();
 }
        public void Configure(
            ICakeContainerRegistrar registrar,
            ICakeConfiguration configuration,
            IRemainingArguments arguments)
        {
            _decorated.Configure(registrar, configuration, arguments);

            foreach (var action in _actions)
            {
                action(registrar);
            }
        }
Exemple #10
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services
            .AddMvc(options =>
            {
                options.EnableEndpointRouting = false;
            })
            .AddJsonOptions(options =>
            {
                options.JsonSerializerOptions.IgnoreNullValues = false;
            });

            string connectionString = Configuration.GetConnectionString("Sstu");
            var    configurator     = new ContainerConfigurator();

            configurator.Configure(services, connectionString);

            services.AddControllers();
        }
Exemple #11
0
        public void Configuration(IAppBuilder app)
        {
            var builder = ContainerConfigurator.Configure();
            var config  = new HttpConfiguration();

            config
            .EnableSwagger(c => c.SingleApiVersion("v1", "Swisscom Onboarding API"))
            .EnableSwaggerUi();

            config.MapHttpAttributeRoutes();

            builder.RegisterApiControllers(Assembly.GetExecutingAssembly());

            container = builder.Build();
            config.DependencyResolver = new AutofacWebApiDependencyResolver(container);

            app.UseAutofacMiddleware(container);
            app.UseAutofacWebApi(config);
            app.UseWebApi(config);
        }
Exemple #12
0
 public HarvestService()
 {
     // Configure IoC Container
     kernel = ContainerConfigurator.Configure();
     LogConfigurator.ConfigureForService();
 }
Exemple #13
0
 public ExternalContentService()
 {
     // Configure IoC Container
     containerBuilder = ContainerConfigurator.Configure();
     LogConfigurator.ConfigureForService();
 }
Exemple #14
0
 /// <summary>
 ///     The data feed service uses a timer to poll the mutation queue for any pending changes.
 ///     Pending changes are then put on the bus for further processing.
 /// </summary>
 public DataFeedService()
 {
     // Configure IoC Container
     kernel = ContainerConfigurator.Configure();
     LogConfigurator.ConfigureForService();
 }
Exemple #15
0
 public MonitoringService()
 {
     // Configure IoC Container
     builder = ContainerConfigurator.Configure();
     LogConfigurator.ConfigureForService();
 }
 public RepositoryService()
 {
     // Configure IoC Container
     containerBuilder = ContainerConfigurator.Configure();
     LogConfigurator.ConfigureForService();
 }
 public DocumentService()
 {
     containerBuilder = ContainerConfigurator.Configure();
     LogConfigurator.ConfigureForService();
 }
Exemple #18
0
 public RepositoryService()
 {
     // Configure IoC Container
     kernel = ContainerConfigurator.Configure();
     LogConfigurator.ConfigureForService();
 }
 public HarvestService()
 {
     // Configure IoC Container
     containerBuilder = ContainerConfigurator.Configure();
     LogConfigurator.ConfigureForService();
 }
Exemple #20
0
 /// <summary>
 ///     The data feed service uses a timer to poll the mutation queue for any pending changes.
 ///     Pending changes are then put on the bus for further processing.
 /// </summary>
 public DataFeedService()
 {
     // Configure IoC Container
     containerBuilder = ContainerConfigurator.Configure();
     LogConfigurator.ConfigureForService();
 }
Exemple #21
0
 public NotificationService()
 {
     containerBuilder = ContainerConfigurator.Configure();
     LogConfigurator.ConfigureForService();
 }
 public DocumentService()
 {
     kernel = ContainerConfigurator.Configure();
     LogConfigurator.ConfigureForService();
 }
 public NotificationService()
 {
     kernel = ContainerConfigurator.Configure();
     LogConfigurator.ConfigureForService();
 }
Exemple #24
0
 static void Main(string[] args)
 {
     ContainerConfigurator.Configure();
     ListAllProducts();
 }
 protected override void OnStartup(StartupEventArgs e)
 {
     base.OnStartup(e);
     ContainerConfigurator.Configure();
 }
 public ExternalContentService()
 {
     // Configure IoC Container
     kernel = ContainerConfigurator.Configure();
     LogConfigurator.ConfigureForService();
 }