public async Task <bool> CanSignUp(SignUpDTORequest signUpRequest) { var arr = await base.Get(); var query = from user in arr where user.Login == signUpRequest.Login || user.Email == signUpRequest.EmailAddress select user; return(!query.Any()); }
public async Task <User> SignUp(SignUpDTORequest signUpRequest, int avatarId) { User user = new User() { Login = signUpRequest.Login, Firstname = signUpRequest.Firstname, Lastname = signUpRequest.Lastname, Gender = signUpRequest.Gender, WeightKg = 79, // FIXME Email = signUpRequest.EmailAddress, LastLoginDate = null, PasswordHash = signUpRequest.PasswordHash, AvatarId = avatarId, GoogleAccessToken = null, GoogleRefreshToken = null, GoogleAccessExpiration = null, CreationDate = DateTime.Now }; return(await Insert(user)); }