Manoj Maharana

Manoj Maharana

  • NA
  • 362
  • 127.9k

Decrypt the Particular column in linq

Mar 22 2017 11:53 AM


Decrypt the Particular column(i.e.Email) of a list from a list using linq.

Here is the code:

  1. List<sp_Ticketlist_Result> _dbData;              
  2.             _dbData = _repository.GetTicket(UserId).ToList();    

In this _dbData a column name Email.This email is decrypted.

Here is the class to encypt the Email (AESCryptography.AES256_Decrypt). I am try this code :

_dbData = (decrypted.ToList().Select(u => AESCryptography.AES256_Decrypt(u.Email))).ToList();

but not working.

I want to Fetch the list with the email column decrypted value.

 
I am trying this also but there is some problem.
 
  1. List decrypted = new List();  
  2. foreach (var item in _dbData)  
  3. {  
  4.       decrypted.add(new ListItem() {  
  5.             EMail = AESCryptography.AES256_Decrypt(item)  
  6.       }  
  7. }  
 

Answers (1)