Ejemplo n.º 1
0
        private void Initialize()
        {
            rootElement = new Element {
                Id = Guid.NewGuid(), Name = "Root"
            };
            attr1 = new Attribute {
                Id = Guid.NewGuid(), ElementId = rootElement.Id, Name = "Attr1"
            };
            attr2 = new Attribute {
                Id = Guid.NewGuid(), ElementId = rootElement.Id, Name = "Attr2"
            };
            val1 = new Value {
                Id = Guid.NewGuid(), Name = "Val1", AttributeId = attr1.Id
            };
            val2 = new Value {
                Id = Guid.NewGuid(), Name = "Val2", AttributeId = attr1.Id
            };
            val3 = new Value {
                Id = Guid.NewGuid(), Name = "Val3", AttributeId = attr2.Id
            };
            val4 = new Value {
                Id = Guid.NewGuid(), Name = "Val4", AttributeId = attr2.Id
            };
            var cachier = container.GetExportedValue <ITypedPool>();

            cachier.Post(rootElement.Id, rootElement);
            cachier.Post(attr1.Id, attr1);
            cachier.Post(attr2.Id, attr2);
            cachier.Post(val1.Id, val1);
            cachier.Post(val2.Id, val2);
            cachier.Post(val3.Id, val3);
            cachier.Post(val4.Id, val4);
        }
Ejemplo n.º 2
0
        private void Initialize()
        {
            rootElement = new Element { Id = Guid.NewGuid(), Name = "Root" };
            attr1 = new Attribute { Id = Guid.NewGuid(), ElementId = rootElement.Id, Name = "Attr1" };
            attr2 = new Attribute { Id = Guid.NewGuid(), ElementId = rootElement.Id, Name = "Attr2" };
            val1 = new Value { Id = Guid.NewGuid(), Name = "Val1", AttributeId = attr1.Id };
            val2 = new Value { Id = Guid.NewGuid(), Name = "Val2", AttributeId = attr1.Id };
            val3 = new Value { Id = Guid.NewGuid(), Name = "Val3", AttributeId = attr2.Id };
            val4 = new Value { Id = Guid.NewGuid(), Name = "Val4", AttributeId = attr2.Id };          
            var cachier = container.GetExportedValue<ITypedPool>();
            cachier.Post(rootElement.Id,rootElement);
            cachier.Post(attr1.Id, attr1);
            cachier.Post(attr2.Id, attr2);
            cachier.Post(val1.Id, val1);
            cachier.Post(val2.Id, val2);
            cachier.Post(val3.Id, val3);
            cachier.Post(val4.Id, val4);



        }