I have an Extension Method
public static bool Between<T1, T2>(this T1 Foo, T2 bar) where T1: IComparable
{
//Body
}
How to restrict my EM so that both T1: IComparable and T2: IConvertible
I tried
T1: IComparable, T2: IConvertible
but gives error. Then how to write?
Try this:
For more information on Constraints on Type Parameters, look here:
http://msdn.microsoft.com/en-us/library/d5x73970.aspx