示例#1
0
 public CdnRouter(ICdnServerRepository cdnServerRepository,
                  ICdnServerService cdnServerService,
                  IConfiguration configuration)
 {
     _cdnServerRepository = cdnServerRepository ?? throw new ArgumentNullException(nameof(cdnServerRepository));
     _cdnServerService    = cdnServerService ?? throw new ArgumentNullException(nameof(cdnServerService));
     _configuration       = configuration ?? throw new ArgumentNullException(nameof(configuration));
 }
示例#2
0
 public ObjectController(IFileObjectRepository fileObjectRepository,
                         IObjectCacheService objectCacheService,
                         ICdnServerService cdnServerService,
                         IOptions <CdnOptions> cdnOptions)
 {
     _fileObjectRepository = fileObjectRepository ?? throw new ArgumentNullException(nameof(fileObjectRepository));
     _objectCacheService   = objectCacheService ?? throw new ArgumentNullException(nameof(objectCacheService));
     _cdnServerService     = cdnServerService ?? throw new ArgumentNullException(nameof(cdnServerService));
     _cdnOptions           = cdnOptions?.Value ?? throw new ArgumentNullException(nameof(_cdnOptions));
 }
        public ObjectCacheService(ICdnServerService cdnServerService,
                                  IFileObjectRepository fileObjectRepository,
                                  IHostingEnvironment hostingEnvironment,
                                  IConfiguration configuration)
        {
            _cdnServerService     = cdnServerService ?? throw new ArgumentNullException(nameof(cdnServerService));
            _fileObjectRepository = fileObjectRepository ?? throw new ArgumentNullException(nameof(fileObjectRepository));
            _hostingEnvironment   = hostingEnvironment ?? throw new ArgumentNullException(nameof(hostingEnvironment));

            _storageOptions = configuration?.GetSection(ConfigurationConstants.STORAGE_SECTION_NAME).Get <StorageOptions>() ?? throw new ArgumentNullException(nameof(configuration));
            _cdnOptions     = configuration?.GetSection(ConfigurationConstants.CDN_SECTION_NAME).Get <CdnOptions>() ?? throw new ArgumentNullException(nameof(configuration));
        }