Example #1
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            BDRoot.InjectEAPI(services);

            services.AddSingleton <IBatchWorker, GeneratorManager>();
            services.AddSingleton <IBatchNumberWorker, MultiplierManager>();

            services.AddControllers().AddNewtonsoftJson(options =>
            {
                options.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore;
            });

            services.AddCors(options =>
            {
                options.AddDefaultPolicy(
                    builder =>
                {
                    builder
                    .AllowAnyOrigin()
                    .AllowAnyMethod()
                    .AllowAnyHeader();
                });
            });

            services.AddSwaggerGen();

            services.AddHostedService <ProcessorBackgroundService>();
        }
Example #2
0
        public void ConfigureServices(IServiceCollection services)
        {
            BDRoot.InjectIAPI(services);

            services.AddGrpc(options =>
            {
                options.EnableDetailedErrors = true;
            });
        }