示例#1
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddApplicationInsightsTelemetry(Configuration);

            services.AddControllers();

            services.AddSignalR();

            services.AddSwaggerDocument(o => { o.Title = "MyNoSqlServer"; });

            var settings = SettingsLoader.LoadSettings();

            settings.BackupAzureConnectString.BindAzureStorage();

            ServiceLocator.DataSynchronizer = new ChangesPublisherToSocket();

            ServiceLocator.SnapshotSaverEngine.Start();
        }
示例#2
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            _services = services;

            services.AddApplicationInsightsTelemetry(Configuration);

            services.AddControllers();

            services.AddSignalR();

            services.AddSwaggerDocument(o => { o.Title = "MyNoSqlServer"; });

            _settings = SettingsLoader.LoadSettings();

            services.BindDomainsServices();
            services.BindAzureStorage(_settings.BackupAzureConnectString);
            services.BindApiServices();
        }
示例#3
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddApplicationInsightsTelemetry(Configuration);

            services.AddMvc(o => { o.EnableEndpointRouting = false; })
            .AddNewtonsoftJson();

            /*
             * services.Configure<ForwardedHeadersOptions>(options =>
             * {
             *  options.ForwardedHeaders =
             *      ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto;
             * });
             *
             */

            services.AddSignalR();


            services.AddSwaggerDocument();

            // Register the Swagger generator, defining 1 or more Swagger documents
            //         services.AddSwaggerGen(c =>
            //         {
            //             c.SwaggerDoc("v1", new OpenApiInfo
            //            {
            //                Title = "MyNoSql API",
            //                Version = "1.0"

//                });
            //           });


            var settings = SettingsLoader.LoadSettings();

            settings.BackupAzureConnectString.BindAzureStorage();

            ServiceLocator.DataSynchronizer = new ChangesPublisherToSignalR();


            ServiceLocator.SnapshotSaverEngine.Start();
        }