Пример #1
0
        public async Task <SpecResult> IsUserPhoneUnique(CleanPhone phone)
        {
            if (await _db.Users.AnyAsync(x => x.Phone == phone.Clean))
            {
                return(SpecResult.No("PHONE_NOT_UNIQUE", "Номер пользователя не уникален"));
            }

            return(SpecResult.Yes());
        }
Пример #2
0
        public async Task <SpecResult> IsUserEmailUnique(string email)
        {
            if (await _db.Users.AnyAsync(x => x.Email == email))
            {
                return(SpecResult.No("EMAIL_NOT_UNIQUE", "Email пользователя не уникален"));
            }

            return(SpecResult.Yes());
        }
Пример #3
0
 public async Task <SpecResult> IsUserCodeCorrect(CleanPhone phone, string code)
 {
     return(SpecResult.No("INVALID_CODE", "Код неверен"));
 }