private static TelnyxOptions GetTelnyxOptions(this IServiceCollection services) { var telnyxOptions = (TelnyxOptions?)services.FirstOrDefault(x => x.ServiceType == typeof(TelnyxOptions))?.ImplementationInstance; if (telnyxOptions == null) { telnyxOptions = new TelnyxOptions(); services.AddSingleton(telnyxOptions); } return(telnyxOptions); }
public Dial(ITelnyxClient telnyxClient, TelnyxOptions telnyxOptions) { _telnyxClient = telnyxClient; _telnyxOptions = telnyxOptions; }