I'm making a generic method in which the Type of T is gonna be int, long, float, or double. I've searched and came up with this solution and now want to exclude DateTime from the generic constraints.
What I want is something like:
class SomeGeneric<T> where T : unmanaged, IComparable, IEquatable<T> not System.Runtime.Serialization.ISerializable
{
//...
}
As DateTime is inheriting from all the interfaces that my numeric types are inheriting but DateTime is inheriting from ISerializable as well so I want to exclude ISerializable.