I have the following method:
public static IResult Validate(this T value) {
} // Validate
How can I restrict T t
You can't restrict generics in that way, you can only choose a single class as a constraint. You must either make 5 overloads or find a interface all 5 of those things share and use that. Which option you choose will depend on what Validate doe.
Here is how you would do the overloads.
public static IResult Validate(this Int16 value) {
} // Validate
public static IResult Validate(this Int32 value) {
} // Validate
public static IResult Validate(this Int64 value) {
} // Validate
public static IResult Validate(this double value) {
} // Validate
public static IResult Validate(this String value) {
} // Validate
Here is by using a common interface, all of the members you list Implement IConvertible so you could restrict by that, however this will allow any IConvertible not just the 5 you listed.
public static IResult Validate(this T value) where IConvertible {
} // Validate