Exemple #1
0
        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);
        }
Exemple #2
0
 public Dial(ITelnyxClient telnyxClient, TelnyxOptions telnyxOptions)
 {
     _telnyxClient  = telnyxClient;
     _telnyxOptions = telnyxOptions;
 }