Exemplo n.º 1
0
 public Daemon(IMessageHandlerFactory messageHandlerFactory,
               IOptions <DaemonOptions> options,
               ILogger <Daemon> logger)
 {
     this.messageHandlerFactory = messageHandlerFactory;
     this.options = options.Value;
     this.options.ThrowIfInvalid();
     this.logger = logger;
 }
 public static void AddDaemon(this IServiceCollection services, IConfiguration configuration)
 {
     services.AddHostedService <Daemon>();
     services.Configure <DaemonOptions>(DaemonOptions.From(configuration));
 }