Example #1
0
        /// <summary>
        /// DNTCaptcha TagHelper
        /// </summary>
        public DNTCaptchaTagHelper(
            ICaptchaProtectionProvider captchaProtectionProvider,
            IRandomNumberProvider randomNumberProvider,
            IHumanReadableIntegerProvider humanReadableIntegerProvider,
            ICaptchaStorageProvider captchaStorageProvider,
            IAntiforgery antiforgery)
        {
            captchaProtectionProvider.CheckArgumentNull(nameof(captchaProtectionProvider));
            randomNumberProvider.CheckArgumentNull(nameof(randomNumberProvider));
            humanReadableIntegerProvider.CheckArgumentNull(nameof(humanReadableIntegerProvider));
            captchaStorageProvider.CheckArgumentNull(nameof(captchaStorageProvider));
            antiforgery.CheckArgumentNull(nameof(antiforgery));

            _captchaProtectionProvider    = captchaProtectionProvider;
            _randomNumberProvider         = randomNumberProvider;
            _humanReadableIntegerProvider = humanReadableIntegerProvider;
            _captchaStorageProvider       = captchaStorageProvider;
            _antiforgery = antiforgery;
        }
        /// <summary>
        /// DNTCaptcha TagHelper
        /// </summary>
        public DNTCaptchaTagHelper(
            ICaptchaProtectionProvider captchaProtectionProvider,
            IRandomNumberProvider randomNumberProvider,
            Func <DisplayMode, ICaptchaTextProvider> captchaTextProvider,
            ICaptchaStorageProvider captchaStorageProvider,
            IAntiforgery antiforgery,
            ISerializationProvider serializationProvider
            )
        {
            captchaProtectionProvider.CheckArgumentNull(nameof(captchaProtectionProvider));
            randomNumberProvider.CheckArgumentNull(nameof(randomNumberProvider));
            captchaTextProvider.CheckArgumentNull(nameof(captchaTextProvider));
            captchaStorageProvider.CheckArgumentNull(nameof(captchaStorageProvider));
            antiforgery.CheckArgumentNull(nameof(antiforgery));
            serializationProvider.CheckArgumentNull(nameof(serializationProvider));

            _captchaProtectionProvider = captchaProtectionProvider;
            _randomNumberProvider      = randomNumberProvider;
            _captchaTextProvider       = captchaTextProvider;
            _captchaStorageProvider    = captchaStorageProvider;
            _antiforgery           = antiforgery;
            _serializationProvider = serializationProvider;
        }