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()); ; }
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(); }