#548 – No More Than One Class for a Type Parameter Constraint
March 27, 2012 Leave a comment
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