Skip to content

Latest commit

 

History

History
9 lines (7 loc) · 446 Bytes

README.md

File metadata and controls

9 lines (7 loc) · 446 Bytes

This is a sample project for Covariance and Contravariance in C#. Covariance and contravariance allow us to be flexible when dealing with class hierarchy.

Covariance: Covariance allows you to use a derived class where a base class is expected.

Contravariance: Contravariance is applied to parameters. Contravariance allows a method with the parameter of a base class to be assigned to a delegate that expects the parameter of a derived class.