Is this the simplest way to determine if foo
is the same or derived from type T
bool Derives<T>(object foo)
{
return foo is T;
}
and an exact match would be
bool ExactMatch<T>(object foo)
{
return foo.GetType() == typeof(T);
}
Is this the simplest way to determine if foo
is the same or derived from type T
bool Derives<T>(object foo)
{
return foo is T;
}
and an exact match would be
bool ExactMatch<T>(object foo)
{
return foo.GetType() == typeof(T);
}
I can't think of a simpler way :)
(and in 'answer' format, to please the trolls: "Yes")