+ 2
Why am I getting error IDictionary does not contains definition for ContainsValue method ? [solved]
3 Antworten
+ 5
Because there is no ContainsValue method defined in IDictionary!
So line 51 gives error.
You can read the docs to see all the existing methods..
https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.idictionary-2?view=net-5.0#methods
You'll need to use Dictionary to use ContainsValue method.
+ 4
Abhay You're welcome :)
But they are not the same..
IDictionary is an interface while Dictionary is a class..
But for more info you should read the docs..
They will clear up the differences :)
Edit:
Maybe this will help 👇
https://forums.asp.net/t/2131680.aspx?Idictionary%2Bvs%2BDictionary%2Breturn%2Bin%2Bmethod%2B
+ 3
Minho 🇰🇷 ty :) i thought Dictionary and IDictionary was same thing lol!