Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 

28 wiersze
1.2 KiB

  1. using JT808.Gateway.Abstractions;
  2. using Microsoft.Extensions.DependencyInjection;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Text;
  6. namespace JT808.Gateway.MsgLogging
  7. {
  8. public static class JT808MsgLoggingExtensions
  9. {
  10. public static IJT808ClientBuilder AddMsgLogging<TJT808MsgLogging>(this IJT808ClientBuilder jT808ClientBuilder)
  11. where TJT808MsgLogging: IJT808MsgLogging
  12. {
  13. jT808ClientBuilder.JT808Builder.Services.AddSingleton(typeof(IJT808MsgLogging),typeof(TJT808MsgLogging));
  14. jT808ClientBuilder.JT808Builder.Services.AddHostedService<JT808MsgDownLoggingHostedService>();
  15. jT808ClientBuilder.JT808Builder.Services.AddHostedService<JT808MsgUpLoggingHostedService>();
  16. return jT808ClientBuilder;
  17. }
  18. public static IJT808GatewayBuilder AddMsgLogging<TJT808MsgLogging>(this IJT808GatewayBuilder jT808NormalGatewayBuilder)
  19. where TJT808MsgLogging : IJT808MsgLogging
  20. {
  21. jT808NormalGatewayBuilder.JT808Builder.Services.AddSingleton(typeof(IJT808MsgLogging), typeof(TJT808MsgLogging));
  22. return jT808NormalGatewayBuilder;
  23. }
  24. }
  25. }