Greetings
I’m wondering if it is possible to create a single method with a random type.
Something like:
public static T CheckWhatTIs(object source)
{
MessageBox.Show("T = " + T.GetType());
}
where I would get “T = bool” when I use it as CheckWhatTIs(true);
and get “T = int” when I use it as CheckWhatTIs(1);
Is it possible to accomplish this ?
Few remarks:
CheckWhatTIs(1)andCheckWhatTIs(true)don’t declare it as an extension method, removethisfrom the parameters.