TrSdkStartupExtensions.cs 629 B

1234567891011121314151617181920
  1. using Hotline.CallCenter.Tels;
  2. using Microsoft.Extensions.DependencyInjection;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. namespace Tr.Sdk
  9. {
  10. public static class TrSdkStartupExtensions
  11. {
  12. public static IServiceCollection AddTrSdk(this IServiceCollection services, string baseUrl, string apiKey, string apiSecret)
  13. {
  14. services.AddSingleton<ITrClient, TrClient>(_ => new TrClient(baseUrl, apiKey, apiSecret));
  15. services.AddScoped<ICallTelClient, CallTelClient>();
  16. return services;
  17. }
  18. }
  19. }