© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago•
29 replies
UnemployedNinja

Check if an object is a Dictionary of any type

I'm trying to type-check a method parameter using
if (dict.GetType() == typeof(Dictionary))
if (dict.GetType() == typeof(Dictionary))
.
How can I check for all types of
Dictionary
Dictionary
without having to write them all out.

Or am I wasting my time here, since the language has type-checking anyway?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

Double check if an object is one of provided types
C#CC# / help
4y ago
❔ Check if Type is static
C#CC# / help
3y ago
❔ Type is Typeof Dictionary
C#CC# / help
3y ago