public bool Validate(Guid id, string text)
        {
            Connect();
            SimpleCaptchaResult captcha = _client.Get <SimpleCaptchaResult>(id.ToString());

            return(string.Equals(captcha.Text, text, StringComparison.CurrentCultureIgnoreCase));
        }
Esempio n. 2
0
 public void Remove(Guid id)
 {
     lock (CaptchaList)
     {
         SimpleCaptchaResult captcha = CaptchaList.SingleOrDefault(c => c.Id == id);
         if (captcha != null)
         {
             CaptchaList.Remove(captcha);
         }
     }
 }
Esempio n. 3
0
        public bool Validate(Guid id, string text)
        {
            SimpleCaptchaResult captcha = CaptchaList.SingleOrDefault(c => c.Id == id && c.Text.ToUpperInvariant() == text.ToUpperInvariant());

            return(captcha != null);
        }
Esempio n. 4
0
 public void Add(SimpleCaptchaResult captcha)
 {
     lock (CaptchaList) {
         CaptchaList.Add(captcha);
     }
 }
 public void Add(SimpleCaptchaResult captcha)
 {
     Connect();
     _client.Add <SimpleCaptchaResult>(captcha.Id.ToString(), captcha, DateTimeOffset.Now.AddMinutes(Convert.ToInt32(_configuration["RepositoryTTLMinutes"], CultureInfo.InvariantCulture)));
 }