public bool Validate(Guid id, string text) { Connect(); SimpleCaptchaResult captcha = _client.Get <SimpleCaptchaResult>(id.ToString()); return(string.Equals(captcha.Text, text, StringComparison.CurrentCultureIgnoreCase)); }
public void Remove(Guid id) { lock (CaptchaList) { SimpleCaptchaResult captcha = CaptchaList.SingleOrDefault(c => c.Id == id); if (captcha != null) { CaptchaList.Remove(captcha); } } }
public bool Validate(Guid id, string text) { SimpleCaptchaResult captcha = CaptchaList.SingleOrDefault(c => c.Id == id && c.Text.ToUpperInvariant() == text.ToUpperInvariant()); return(captcha != null); }
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))); }