private bool HasCode(int userId, string email, int code) { EmailVerifies emailVerifier = emailVerifierRepository .GetWhere(e => IsRequestedEmailVerifier(e, userId, email)).FirstOrDefault(); if (emailVerifier == null) { throw new ArgumentNullException(); } return(emailVerifier.Equals(userId, email, code)); }
public async Task ClearUserVereficationsStory(int userId) { IEnumerable <EmailVerifies> verifications = emailVerifierRepository.GetWhere(e => e.UserId == userId); await emailVerifierRepository.Remove(verifications.ToArray()); }