SyntaxFix
Write A Post
Hire A Developer
Questions
int result= YourDictionaryName.TryGetValue(key, out int value) ? YourDictionaryName[key] : 0;
If the key is present in the dictionary, it returns the value of the key otherwise it returns 0.
Hope, this code helps you.