コード例 #1
0
        public FileBackedStateManager(ILogger <IStateManager <T> > logger,
                                      IOptions <FileBackedConfig <FileBackedStateManager <T> > > options,
                                      FileBackedConfigValidator <FileBackedStateManager <T> > fileBackedConfigValidator,
                                      IFileSystem fileSystem)
            : base(logger)
        {
            _logger                    = logger ?? throw new ArgumentNullException(nameof(logger));
            _fileBackedConfig          = options?.Value ?? throw new ArgumentNullException(nameof(options));
            _fileBackedConfigValidator = fileBackedConfigValidator ?? throw new ArgumentNullException(nameof(fileBackedConfigValidator));
            _fileSystem                = fileSystem ?? throw new ArgumentNullException(nameof(fileSystem));

            _fileBackedConfigValidator.ValidateAndThrow(_fileBackedConfig);
        }
コード例 #2
0
        public FileBackedInstalledAppManager(ILogger <IInstalledAppManager> logger,
                                             ISmartThingsAPIHelper smartThingsAPIHelper,
                                             IOptions <FileBackedConfig <FileBackedInstalledAppManager> > options,
                                             FileBackedConfigValidator <FileBackedInstalledAppManager> fileBackedConfigValidator,
                                             IFileSystem fileSystem)
            : base(logger, smartThingsAPIHelper)
        {
            _logger = logger ??
                      throw new ArgumentNullException(nameof(logger));
            _fileBackedConfig          = options?.Value ?? throw new ArgumentNullException(nameof(options));
            _fileBackedConfigValidator = fileBackedConfigValidator ?? throw new ArgumentNullException(nameof(fileBackedConfigValidator));
            _fileSystem = fileSystem ?? throw new ArgumentNullException(nameof(fileSystem));

            _fileBackedConfigValidator.ValidateAndThrow(_fileBackedConfig);
        }