public void RefreshDbContext(string connectionString) { if (Context != null) { Context.Dispose(); } var optionsBuilder = new DbContextOptionsBuilder <DWDbContext>(); optionsBuilder.UseSqlServer(connectionString); Context = new DWDbContext(optionsBuilder.Options); }
public DWRepository(DWDbContext dwcontext) { this.Context = dwcontext; }