This repository was archived by the owner on Nov 7, 2018. It is now read-only.
This repository was archived by the owner on Nov 7, 2018. It is now read-only.
Add extension methods for reloadable options #96
Closed
Description
We want to add a set of extension methods for linking common patterns of use for reloadable options:
public static void Subscribe(this IFileProvider fileProvider, string filename, IConfigurationRoot configuration)
{
ChangeToken.OnChange((f) => f.Watch(filename), () => configuration.Reload());
}
public static void Subscribe<TOptions>(this IConfigurationRoot configuration, IReloadOptionsManager reload)
{
ChangeToken.OnChange((c) => c.GetReloadToken(), () => reload.Reload<TOptions>());
}
These may live here, or in another repo.