Пример #1
0
        /// <summary>
        /// DNTCaptcha Image Controller
        /// </summary>
        public DNTCaptchaImageController(
            ICaptchaImageProvider captchaImageProvider,
            ICaptchaProtectionProvider captchaProtectionProvider,
            ITempDataProvider tempDataProvider,
            ICaptchaStorageProvider captchaStorageProvider)
        {
            captchaImageProvider.CheckArgumentNull(nameof(captchaImageProvider));
            captchaProtectionProvider.CheckArgumentNull(nameof(captchaProtectionProvider));
            tempDataProvider.CheckArgumentNull(nameof(tempDataProvider));
            captchaStorageProvider.CheckArgumentNull(nameof(captchaStorageProvider));

            _captchaImageProvider      = captchaImageProvider;
            _captchaProtectionProvider = captchaProtectionProvider;
            _tempDataProvider          = tempDataProvider;
            _captchaStorageProvider    = captchaStorageProvider;
        }
        /// <summary>
        /// DNTCaptcha Image Controller
        /// </summary>
        public DNTCaptchaImageController(
            ICaptchaImageProvider captchaImageProvider,
            ICaptchaCryptoProvider captchaProtectionProvider,
            ITempDataProvider tempDataProvider,
            ICaptchaStorageProvider captchaStorageProvider,
            ILogger <DNTCaptchaImageController> logger,
            ISerializationProvider serializationProvider)
        {
            captchaImageProvider.CheckArgumentNull(nameof(captchaImageProvider));
            captchaProtectionProvider.CheckArgumentNull(nameof(captchaProtectionProvider));
            tempDataProvider.CheckArgumentNull(nameof(tempDataProvider));
            captchaStorageProvider.CheckArgumentNull(nameof(captchaStorageProvider));
            logger.CheckArgumentNull(nameof(logger));
            serializationProvider.CheckArgumentNull(nameof(serializationProvider));

            _captchaImageProvider      = captchaImageProvider;
            _captchaProtectionProvider = captchaProtectionProvider;
            _tempDataProvider          = tempDataProvider;
            _captchaStorageProvider    = captchaStorageProvider;
            _logger = logger;
            _serializationProvider = serializationProvider;
        }
Пример #3
0
        public DNTCaptchaMiddleware(
            RequestDelegate next,
            ICaptchaImageProvider captchaImageProvider,
            ICaptchaProtectionProvider captchaProtectionProvider,
            ITempDataProvider tempDataProvider,
            ICaptchaStorageProvider captchaStorageProvider,
            ILogger <DNTCaptchaImageController> logger)
        {
            this._next = next;

            captchaImageProvider.CheckArgumentNull(nameof(captchaImageProvider));
            captchaProtectionProvider.CheckArgumentNull(nameof(captchaProtectionProvider));
            tempDataProvider.CheckArgumentNull(nameof(tempDataProvider));
            captchaStorageProvider.CheckArgumentNull(nameof(captchaStorageProvider));
            captchaStorageProvider.CheckArgumentNull(nameof(logger));

            _captchaImageProvider      = captchaImageProvider;
            _captchaProtectionProvider = captchaProtectionProvider;
            _tempDataProvider          = tempDataProvider;
            _captchaStorageProvider    = captchaStorageProvider;
            _logger = logger;
        }