when used Dictionary
How can I get the value if it non nullable value type this code
Dictionary<string, object> DictionaryValues = new Dictionary<string, object>();
RSAParameters publicKey = Storage.Read(_Path + @"\" + "Key.Public");
DictionaryValues["publicKey"] = publicKey;
RSAParameters publicKey2 = new RSAParameters();
if (DictionaryValues.TryGetValue("publicKey", out object obj))
{
publicKey2 = obj as RSAParameters;
}
I'm getting an error the as operator must be used with a reference type or nullable type RSAParameters is anon nullable
How can I get the value publicKey from inside the dictionary Please help and thank you everyone
//publicKey2 = obj as RSAParameters;
publicKey2 = (RSAParameters)obj;
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments