예제 #1
0
 public CommandProcessor(INotifier notifier,
                         IReportingService service,
                         IDbAccessor dbAccessor,
                         IMailSender mailSender,
                         IPinGenerator pinGenerator,
                         IServiceProvider serviceProvider,
                         IOptions <Config> options)
 {
     _notifier        = Arg.NotNull(notifier, nameof(notifier));
     _service         = Arg.NotNull(service, nameof(service));
     _config          = Arg.NotNull(options.Value, nameof(options));
     _dbAccessor      = Arg.NotNull(dbAccessor, nameof(dbAccessor));
     _mailSender      = Arg.NotNull(mailSender, nameof(mailSender));
     _pinGenerator    = Arg.NotNull(pinGenerator, nameof(pinGenerator));
     _serviceProvider = Arg.NotNull(serviceProvider, nameof(serviceProvider));
 }
예제 #2
0
 protected override void InjectDependencies(IServiceProvider serviceProvider)
 {
     _pinGenerator = Arg.NotNull(serviceProvider.GetService <IPinGenerator>(), $"{nameof(IPinGenerator)} is not resolved");
     _mailSender   = Arg.NotNull(serviceProvider.GetService <IMailSender>(), $"{nameof(IMailSender)} is not resolved");
 }