Vote count:
0
I have a complex Query.
I want to check if an items exists inside a List (softwareLicencesList) based on Key and value. However the data inside the softwareLicencesList is Encrypted. So first I want to decrypt it and then do a lookup inside a Dictionary (dict) to get the mapped value and then verify the mapped value against the hardwareInfo Keys (hardwareInfo is Dictionary which stores machine hardware information). Once the Key is verified then I want to match the value.
I wrote the following piece of code to do this. Well this code works but I would like to know if it can be optimized further.
foreach (var i in hardwareInfo)
{
if (!softwareLicencesList.Exists(x => dict.FirstOrDefault(y => y.Key == Crypt.Decrypt(x.Key, "Encryption Key")).Value == i.Key
&& Crypt.VerifyHash(i.Value, "MD5", x.Value)))
{
//Do Something
}
}
asked 25 secs ago
Optimationztion of LookUp like LINQ Query
Aucun commentaire:
Enregistrer un commentaire