Comparing types when using reflection
I'm using the reflection system, and want to check the type of an attribute (this may not be relevant here, but I wanted to give some context)
I'm iterating over method custom attributes, and want to check if one of them is a specific type (
I thought I'd be able to do this:
However, it never hits this, and VSCode underlines it in yellow saying
How do I check a type against another type? Google is only helping me with checking an object against a type.
I'm iterating over method custom attributes, and want to check if one of them is a specific type (
MyAttribute)I thought I'd be able to do this:
However, it never hits this, and VSCode underlines it in yellow saying
The given expression is never of the provided ('MyAttribute') typeHow do I check a type against another type? Google is only helping me with checking an object against a type.