I'm trying to do
myDic.TryGetValue("username", out user.Username);
but its not working.
is this not possible?
No, from the documentation:
"Properties are not variables and therefore cannot be passed as out parameters."
http://msdn.microsoft.com/en-us/library/t3c3bfhx.aspx
To continue John's answer, do this instead:
string username;
if (myDic.TryGetValue("username", out username))
{
user.Username = username;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With