title: when used Dictionary How can I get the value if it non nullable value type
body: <p>when used Dictionary</p>
  <p>How can I get the value if it non nullable value type
  this code</p>
  <pre><code>            Dictionary&lt;string, object&gt; DictionaryValues = new Dictionary&lt;string, object&gt;();
              RSAParameters publicKey = Storage.Read(_Path + @&quot;\&quot; + &quot;Key.Public&quot;);
              DictionaryValues[&quot;publicKey&quot;] = publicKey;
  
  
              RSAParameters publicKey2 = new RSAParameters();
              if (DictionaryValues.TryGetValue(&quot;publicKey&quot;, out object obj))
              {
                  publicKey2 = obj as RSAParameters;
                  
              }
  </code></pre>
  <p>I'm getting an error the as operator must be used with a reference type or nullable type RSAParameters is anon nullable</p>
  <p>How can I get the value  publicKey from inside the dictionary
  Please help and thank you everyone</p>
  <p><a href="https://i.stack.imgur.com/NKPFE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NKPFE.png" alt="enter image description here" /></a></p>