mirror of
https://github.com/AlexMacocian/SystemExtensions.git
synced 2026-07-15 14:19:29 +00:00
e6a06915cd
Codestyle fixes Setup CODEOWNERS Setup dependabot
23 lines
597 B
C#
23 lines
597 B
C#
using System.Configuration;
|
|
|
|
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);
|
|
}
|
|
}
|