예제 #1
0
        private MyModel ConstructComplexGraph()
        {
            var model = new MyModel();
            var t1 = new Thing(1, "Dog");
            var t2 = new Thing(2, "Cat");
            t1.RelatedThing = t2;
            t2.RelatedThing = t1;
            var cat = new Category("Pets");
            cat.Things.Add(t1);
            cat.Things.Add(t2);
            t1.Categories.Add(cat);
            t2.Categories.Add(cat);
            model.AddThing(t1);
            model.AddThing(t2);

            model.Categories.Add(cat.Name, cat);

            model.AddThing(null);
            model.AddThing(new SubThing(3, "Fish") { DingDong = "Woohoo!" });
            return model;
        }
예제 #2
0
 public void AddThing(Thing thing)
 {
     Collection.Things.Add(thing);
 }