public async Task CheckingEmailExists(string email, UserRegisterModelOut response) { if (await _repos.Users.CheckingEmailExists(email)) { response.AddError(CustomErrorEnum.UsedEmail); } }
public async Task Register(UserModel userModel, UserRegisterModelOut response) { User user = _mapper.Map <User>(userModel); await _repos.Users.Create(user); if (await _repos.SaveAsync() == 0) { response.AddError(CustomErrorEnum.UnsuccessfulRegister); } }