LANGUAGE

Contravariant type parameter

Declares a contravariant interface parameter, enabling appropriate base-to-derived consumer conversions.

Formal Syntax & Structure

csharp syntaxcsharp
interface IConsumer<in T> { void Put(T value); }

Working Example

Example Snippetcsharp
interface IConsumer<in T> { void Put(T value); }
C# & .NET Reference