public MessageClientImpl(ILogger <MessageClientImpl> logger, IOptions <MessageClientOptions> options) { this.logger = logger; this.options = options.Value; this.options.ThrowIfInvalid(); }
public static void AddMessageClient(this IServiceCollection services, IConfiguration configuration) { services.AddSingleton <IMessageClient, MessageClientImpl>(); services.Configure <MessageClientOptions>(MessageClientOptions.From(configuration)); }