▁a ▁typing ▁rule ▁or ▁a ▁type ▁constructor ▁is : ▁ ▁cov ari ant ▁if ▁it ▁pres erves ▁the ▁ordering ▁of ▁types ▁( ≤ ), ▁which ▁orders ▁types ▁from ▁more ▁specific ▁to ▁more ▁generic ; ▁▁ ▁cont rav ari ant ▁if ▁it ▁revers es ▁this ▁ordering ; ▁ ▁b ivari ant ▁if ▁both ▁of ▁these ▁apply ▁( i . e ., ▁both ▁▁ ≤ ▁ ▁and ▁▁ ≤ ▁ ▁at ▁the ▁same ▁time ); ▁ ▁variant ▁if ▁cov ari ant , ▁cont rav ari ant ▁or ▁b ivari ant . ▁ ▁invariant ▁or ▁non variant ▁if ▁not ▁variant . ▁ ▁The ▁article ▁cons iders ▁how ▁this ▁applies ▁to ▁some ▁common ▁type ▁construct ors . ▁ ▁C # ▁examples ▁ ▁For ▁example , ▁in ▁C #, ▁if ▁▁ ▁is ▁a ▁sub type ▁of ▁, ▁then : ▁▁ ▁is ▁a ▁sub type ▁of ▁. ▁The ▁sub ty ping ▁is ▁preserved ▁because ▁ ▁is ▁cov ari ant ▁on ▁. ▁▁ ▁is ▁a ▁sub type ▁of ▁. ▁The ▁sub ty ping ▁is ▁revers ed ▁because ▁ ▁is ▁cont rav ari ant ▁on ▁. ▁ ▁Ne ither ▁ ▁nor ▁ ▁is ▁a ▁sub type ▁of ▁the ▁other , ▁because ▁ ▁is ▁invariant ▁on ▁. ▁The ▁variance ▁of ▁a ▁C # ▁generic ▁interface ▁is ▁declared ▁by ▁placing ▁the ▁ ▁( cov ari ant ) ▁or ▁ ▁( cont rav ari ant ) ▁attribute ▁on ▁( zero ▁or ▁more ▁of ) ▁its ▁type ▁parameters . ▁For ▁each ▁so - mark ed ▁type ▁parameter , ▁the ▁compiler ▁conclus ively ▁ver ifies ,