PerformanceDBRegion.cs 791 B

12345678910111213141516171819202122
  1. using Microsoft.Extensions.DependencyInjection;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Text;
  5. namespace XYY.PerformanceCount.Standard
  6. {
  7. public static class PerformanceDBRegion
  8. {
  9. /// <summary>
  10. /// 计数器数据服务ES实现
  11. /// 该服务依赖框架 AspectCore.Extensions.DependencyInjection
  12. /// 启动项添加配置: UseServiceProviderFactory(x => new DynamicProxyServiceProviderFactory())
  13. /// </summary>
  14. /// <param name="services"></param>
  15. /// <param name="connection"></param>
  16. public static void AddPerformanceESDB(this IServiceCollection services, string connection)
  17. {
  18. services.AddSingleton<IPerformanceDB>(x => new ESPerformanceDB(connection));
  19. }
  20. }
  21. }