LANGUAGE

Covariant type parameter

Declares a covariant interface parameter, enabling appropriate derived-to-base reference conversions.

Formal Syntax & Structure

csharp syntaxcsharp
interface IProducer<out T> { T Get(); }

Working Example

Example Snippetcsharp
interface IProducer<out T> { T Get(); }
C# & .NET Reference