/// <summary> /// Overwrite the method onconfigure of DbContext and we configured Database Sql /// </summary> /// <param name="optionsBuilder"></param> protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { optionsBuilder.UseSqlServer(MySettingsDb.GetNetTestConecction(), options => { options.CommandTimeout(200); }); }
// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddControllers(); services.AddDbContext <ApplicactionDbContext>(options => options.UseSqlServer(Configuration.GetConnectionString("RxWebApiConecctionString:ConnectionString"))); MySettingsDb.SetNetTestConecction(Configuration.GetConnectionString("RxWebApiConecctionString:ConnectionString")); }