Dependency Injection extensions

This commit is contained in:
Alexandru Macocian
2021-07-10 10:59:27 +03:00
parent 5aaa0d318a
commit 7a764a5929
40 changed files with 1410 additions and 8 deletions
@@ -0,0 +1,23 @@
using System.Extensions;
namespace System.Extensions.Configuration
{
public sealed class UpdateableOptionsWrapper<T> : IUpdateableOptions<T>
where T : class
{
private readonly IOptionsManager configurationManager;
public T Value { get; }
public UpdateableOptionsWrapper(IOptionsManager configurationManager, T options)
{
this.configurationManager = configurationManager.ThrowIfNull(nameof(configurationManager));
this.Value = options;
}
public void UpdateOption()
{
this.configurationManager.UpdateOptions(this.Value);
}
}
}