public static void Main(string[] args)
            {
                Person parent = new Person {
                    Name = "John"
                };
                Person child1 = new Person {
                    Name = "Chris"
                };
                Person child2 = new Person {
                    Name = "Mary"
                };

                var relationships = new Relationships();

                relationships.AddParentAndChild(parent, child1);
                relationships.AddParentAndChild(parent, child2);

                Research research = new Research(relationships);
            }
Example #2
0
        private static void DependencyInversion()
        {
            var parent = new Person {
                Name = "John"
            };
            var child1 = new Person {
                Name = "Chris"
            };
            var child2 = new Person {
                Name = "Mary"
            };

            var relationships = new Relationships();

            relationships.AddParentAndChild(parent, child1);
            relationships.AddParentAndChild(parent, child2);

            var research = new Research(relationships);
        }