示例#1
0
        public void ConfigureServices(IServiceCollection services)
        {
            var settings = new AppSettings(Configuration);
            services.AddSingleton(x => settings);
            services.AddTransient<ReloadPlayersViewModel>();

            services
                .AddDbContext<Db>(options => { options.UseSqlServer(settings.DatabaseConnectionString); });

            services.AddSignalR(options => { options.Hubs.EnableDetailedErrors = true; });
            services.AddMvc()
                .AddJsonOptions(options => options.SerializerSettings.ContractResolver = new DefaultContractResolver()); ;
        }
示例#2
0
        public void ConfigureServices(IServiceCollection services)
        {
            var settings = new AppSettings(Configuration);
            services.AddSingleton(x => settings);
            services.AddTransient<ReloadPlayersViewModel>();

            services
                .AddEntityFramework()
                .AddSqlServer()
                .AddDbContext<Db>(options => { options.UseSqlServer(settings.DatabaseConnectionString); });

            services.AddSignalR(options => { options.Hubs.EnableDetailedErrors = true; });
            services.AddMvc();
        }