static void Main(string[] args) { SimpleReturn <Dog> dogReturner = new SimpleReturn <Dog>(); dogReturner.items[0] = new Dog() { Name = "Avonlea" }; //SimpleReturn<Animal> animalReturn = dogReturner; //IMyIfc<Dog> dogIMyIfc = dogReturner; //Console.WriteLine(dogIMyIfc.GetFirst().Name); IMyIfc <Animal> animalIMyIfc = dogReturner; Console.WriteLine(animalIMyIfc.GetFirst().Name); //DoSomething(dogReturner); }
static void DoSomething(IMyIfc <Animal> returner) { Console.WriteLine(returner.GetFirst().Name); }