/* * Licensed under the Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0) * See https://github.com/openiddict/openiddict-core for more information concerning * the license and the contributors participating to this project. */ using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; namespace OpenIddict.Client; public class OpenIddictClientFactory : IOpenIddictClientFactory { private readonly ILogger _logger; private readonly IOptionsMonitor _options; /// /// Creates a new instance of the class. /// public OpenIddictClientFactory( ILogger logger, IOptionsMonitor options) { _logger = logger ?? throw new ArgumentNullException(nameof(logger)); _options = options ?? throw new ArgumentNullException(nameof(options)); } public ValueTask CreateTransactionAsync() => new(new OpenIddictClientTransaction { Logger = _logger, Options = _options.CurrentValue }); }