You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

21 lines
820 B

  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 AddJT808MsgLogging<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. }
  19. }