[Question] - Configuration snapshots #174
Description
From @dazinator on March 8, 2017 14:46
Say I follow the docs and create an EF configuration provider. This means I can update the config values directly in the database table. This question isn't specific to EF though, but more generally about providers that allow their values to be modified at runtime.
My question is, how can I make this provider support IOptionsSnapshot
mechanism - i.e so that after values are changed in the source (EF table in this case), the existing snapshots can be flagged as outdated so that new snapshots are obtained next time a request is made through DI.
I am not asking about how to detect changes made in the table itself. Let's assume that my EF provider offers up an Update<TOptions>(TOptions options)
method that it will be used to update the values in underlying table for a particular options class when we wish to modify them. In this instance, after the table has been updated, the provider knows exactly which TOptions
class has had its values changed and so now it needs to make sure new snapshots are created - how does it do that? Couldn't see anything in the docs.
Copied from original issue: aspnet/Mvc#5925