private static MySpecialCollectionList <IBeast> GetSpecialCollectionList() { var ant = new Ant() { Name = "Mr Ant" }; var cat = new Cat() { Name = "Mr Cat" }; var dog = new Dog() { Name = "Mr Dog" }; var Special = new Special <IBeast>(ant); var specialCollection1 = new MySpecialCollection <IBeast>() { Items = { new Special <IBeast>(ant), new Special <IBeast>(cat), new Special <IBeast>(dog) } }; specialCollection1.Name = "Special Collection1"; var specialCollection2 = new MySpecialCollection <IBeast>() { Items = { new Special <IBeast>(ant), new Special <IBeast>(dog) } }; specialCollection2.Name = "Special Collection2"; var specialCollectionList = new MySpecialCollectionList <IBeast>() { Items = { specialCollection1, specialCollection2 } }; specialCollectionList.Name = "Special Collection List"; return(specialCollectionList); }
private static void Main() { MySpecialCollectionList <IBeast> collectionList = GetSpecialCollectionList(); var copy = Serializer.DeepClone(collectionList); }