Exemplo n.º 1
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            //RabbitMQConfig rabbitMQConfig = new RabbitMQConfig();
            CustomerRabbitMQConfig customerRabbitMQConfig = new CustomerRabbitMQConfig();

            //this.Configuration.Bind("RabbitMQ", rabbitMQConfig);
            this.Configuration.Bind("RabbitMQ:CustomerRabbitMQ", customerRabbitMQConfig);
            //services.AddSingleton(rabbitMQConfig);
            services.AddSingleton(customerRabbitMQConfig);

            ServiceCollectionBootstrapper.ConfigureServices(services);

            services.AddCors();

            services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);

            // Register the Swagger generator, defining 1 or more Swagger documents
            services.AddSwaggerGen(c =>
            {
                c.SwaggerDoc("v1", new Info {
                    Title = "POC RabbitMQ API", Version = "v1"
                });
            });
        }
Exemplo n.º 2
0
 public CustomerService(CustomerRabbitMQConfig customerRabbitMQConfig, IRabbitService rabbitService)
 {
     this.CustomerRabbitMQConfig = customerRabbitMQConfig;
     this.RabbitService = rabbitService;
 }