To check if an object is of a certain type in c#, simply use the is statement:

if (myPerson is Person) {
    // Variable is of type Person
}
Published On: February 12, 2019Categories: C#