When specifying constraints for a type parameter in a generic class, you can specify at most one class as a constraint, but you can specify one or more interfaces. If one of the constraints is a class type, it must come first.
// Type must be castable to DogToy and must implement // IEdible and IBuryable public class Dog<TFavToy> where TFavToy : DogToy, IEdible, IBuryable
Filed under: Classes Tagged: C#, Classes, Constraint, Generic Classes, Type Parameters, Where
