I've asked about this quite a while back (basically, why is there no Save method - and there are quite a few other issues covering this topic) and you answered me that there is no support for transactional configuration stores because some configuration stores are already transactional, which I can agree upon. Though it would still be nice to have some way to explicitly save the current configuration, for which I suggest the following implementation:
There will be a marker interface called ITransactionalConfigStore which would inherit the IConfigStore contract and provide additional methods such as SaveChanges, HasUnsavedChanges etc. Only configuration stores which actually support this would implement the contract.
The library would offer static accessors to each method, something like ConfigStore.Save<T>() which would trigger saving all configuration stores implementing this contract.
An additional abstract type should be provided called AsyncConfigStore which periodically saves the current configuration in an asychronous manner.
I totally see your point. I think one can implement transactions outside of the stores themselves, inside the core library, as long as store interface supports batched save.
I've asked about this quite a while back (basically, why is there no
Save
method - and there are quite a few other issues covering this topic) and you answered me that there is no support for transactional configuration stores because some configuration stores are already transactional, which I can agree upon. Though it would still be nice to have some way to explicitly save the current configuration, for which I suggest the following implementation:ITransactionalConfigStore
which would inherit theIConfigStore
contract and provide additional methods such asSaveChanges
,HasUnsavedChanges
etc. Only configuration stores which actually support this would implement the contract.ConfigStore.Save<T>()
which would trigger saving all configuration stores implementing this contract.AsyncConfigStore
which periodically saves the current configuration in an asychronous manner.