7.8. Summary

The goal of the chapter was to provide some clear indication of how constraints can be applied to your generic types. As part of this discussion, the chapter looked at how interface, class, and constructor constraints all separately influence the implementation of a generic type. You also saw how these constraint types could be leveraged in combinations. Along the way, you examined some of the side effects of using multiple constraints for your type parameters and explored some scenarios where these constraints could introduce ambiguity. After looking at all the implications of constraints, you should have a much clearer idea about how constraints are likely to influence the choices you make when creating your own generic types.

Get Professional .NET 2.0 Generics now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.