Beispiel #1
0
 public UsersViewModel GetUserByEmailWithoutDecryption(string email)
 {
     using (var usersRep = UnitOfWork.UsersRepository)
     {
         var usersModel = usersRep.Where(x => x.Email == email && x.IsDeleted == false).FirstOrDefault() ??
                          new Users();
         return(UsersMapper.MapModelToViewModel(usersModel));
     }
 }
Beispiel #2
0
 public UsersViewModel GetUserByEmailAndToken(string email, string resetToken)
 {
     using (var usersRep = UnitOfWork.UsersRepository)
     {
         var usersModel = usersRep.Where(x => x.Email == email && x.IsDeleted == false && x.ResetToken == resetToken).FirstOrDefault();
         if (usersModel != null)
         {
             var encryptPassword = EncryptDecrypt.GetDecryptedData(usersModel.Password, "");
             usersModel.Password = encryptPassword;
         }
         else
         {
             usersModel = new Users();
         }
         return(UsersMapper.MapModelToViewModel(usersModel));
     }
 }