mirror of
https://github.com/AlexMacocian/SystemExtensions.git
synced 2026-07-16 06:29:29 +00:00
24 lines
660 B
C#
24 lines
660 B
C#
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);
|
|
}
|
|
}
|
|
}
|