Is there a way to declare a generic function that the generic type is of type1 or type2?

example:

public void Foo<T>(T number)
{
}

Can I constraint T to be int or long

Edit
Report