This repository has been archived by the owner on Nov 7, 2018. It is now read-only.
This repository has been archived by the owner on Nov 7, 2018. It is now read-only.
IOptionsSnapshot should support scoped IConfigureOptions (ie. DbContext) #160
Closed
Description
Consuming a DbContext to configure options per request should be possible via.
public class DbConfigure : IConfigureServices<MyOptions> {
public DbConfigure(DbContext context) { Context = context; }
public Configure(MyOptions options) {
UseContextToConfigure(options);
}
}
services.AddScoped<IConfigureService<MyOptions>, DbConfigure>();
This doesn't work today because we are caching the options until a change evicts (which works for the singleton IOptions but blocks this scenario)
Activity