Example #1
0
        public async Task <User> InsertUserAsync(User user)
        {
            if (user == null)
            {
                throw new ArgumentNullException("User");
            }

            try
            {
                user.Password = MulakatHelper.HashPassword(user.Password).ToString();
                await userRepo.Insert(user);
                await SaveAsync();

                return(user);
            }
            catch (Exception)
            {
                throw;
            }
        }
Example #2
0
 public async Task <User> GetUserAsync(string eMail, string password)
 {
     password = MulakatHelper.HashPassword(password).ToString();
     return(await userRepo.GetAsync(u => u.Email == eMail && u.Password == password));
 }