I want to test an object to see if it implements IDictionary but I don\'t care what TKey and TValue are.
IDictionary
TKey
TValue
I
How about something like
return type.GetInterfaces() .Where(t => t.IsGenericType) .Select(t => t.GetGenericTypeDefinition()) .Any(t => t.Equals(typeof(IDictionary<,>)));
which I'm sure that you can easily generalize for any generic type definition.