What's the quickest way to check an object's type in C#?
There seems to many ways to do it; as, is, GetType(), typeof, and I want the fastest. The objects I have are simple, and there is no inheritance to worry about.
Here's pseudo code of how it needs to work:
if (x == ClassY)
{
doYStuff();
return
}
if (x == ClassZ)
{
doZStuff();
return
}
Repeat a lot with other Class types...
Suggestions welcome, and hope you're all good.
Thanks.