using System.Extensions; namespace System.Configuration; public sealed class LiveUpdateableOptionsWrapper : ILiveUpdateableOptions where T : class { private readonly IOptionsManager configurationManager; private T value; public T Value { get { this.value = this.configurationManager.GetOptions(); return this.value; } } public LiveUpdateableOptionsWrapper(IOptionsManager configurationManager) { this.configurationManager = configurationManager.ThrowIfNull(nameof(configurationManager)); } public void UpdateOption() { this.configurationManager.UpdateOptions(this.value); } }