Skip to content
This repository has been archived by the owner on Nov 7, 2018. It is now read-only.

Add extension methods for reloadable options #96

Closed
rynowak opened this issue Nov 3, 2015 · 1 comment
Closed

Add extension methods for reloadable options #96

rynowak opened this issue Nov 3, 2015 · 1 comment
Assignees
Milestone

Comments

@rynowak
Copy link
Member

rynowak commented Nov 3, 2015

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.

@HaoK HaoK added this to the 1.0.0-rc2 milestone Nov 5, 2015
@HaoK HaoK self-assigned this Nov 5, 2015
@HaoK
Copy link
Member

HaoK commented Dec 10, 2015

Added to Common in Primatives in ChangeToken static class

@HaoK HaoK closed this as completed Dec 10, 2015
@HaoK HaoK added 3 - Done and removed 2 - Working labels Dec 10, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants