In C# you can use the in and out keywords on a type parameter to indicate variance:
```
interface IProducer<out T> // Covariant
{
T produce();
}
interface IConsumer<in T> // Contravariant
{
void consume(T t);
}
IProducer<B> producerOfB = /*...*/;
IProducer<A> producerOfA = producerOfB; // now legal
// producerOfB = producerOfA; // still illegal
IConsumer<A> consumerOfA = /*...*/;
IConsumer<B> consumerOfB = consumerOfA; // now legal
// consumerOfA = consumerOfB; // still illegal
```
This annotation style is called declaration-site variance because the type parameter is annotated where the generic type is declared.