diff --git a/.images/dotnet_covariant_contravariant.png b/.images/dotnet_covariant_contravariant.png new file mode 100644 index 0000000..a08ac6e Binary files /dev/null and b/.images/dotnet_covariant_contravariant.png differ diff --git a/DotNet/C#/C#.md b/DotNet/C#/C#.md index 0412861..ad2aff8 100644 --- a/DotNet/C#/C#.md +++ b/DotNet/C#/C#.md @@ -2032,6 +2032,8 @@ Generic type parameters support covariance and contravariance to provide greater - **Contravariance**: Enables to use a more generic (less derived) type than originally specified. - **Invariance**: it's possible to use _only_ the type originally specified; so an invariant generic type parameter is neither covariant nor contravariant. +![covariance-vs-contravariance](../../.images/dotnet_covariant_contravariant.png) + **NOTE**: annotate generic type parameters with `out` and `in` annotations to specify whether they should behave covariantly or contravariantly. ```cs