Exemplo n.º 1
0
        protected override void DoProcess()
        {
            ActiveRecordDescriptor ar = Context["ardesc"] as ActiveRecordDescriptor;

            ar.Table = (Context["selectedtable"] as TableDefinition);
            ar.Table.RelatedDescriptor = ar;
//			_shape.ActiveRecordDescriptor = ar;

            // Build dependencies

            IActiveRecordDescriptorBuilder builder =
                ServiceRegistry.Instance[typeof(IActiveRecordDescriptorBuilder)]
                as IActiveRecordDescriptorBuilder;

            BuildContext buildContext = Context["buildcontext"] as BuildContext;

            Dependents = builder.Build(buildContext);
        }
Exemplo n.º 2
0
        public void BlogActiveRecord()
        {
            InitKernel();
            IActiveRecordDescriptorBuilder arbuilder = ObtainService();

            TableDefinition blogTable;
            TableDefinition postTable;

            BuildBlogPostsStructure(out blogTable, out postTable);

            BuildContext context = new BuildContext();

            ActiveRecordDescriptor desc = arbuilder.Build(blogTable, context);

            Assert.IsNotNull(desc);

            Assert.AreEqual("Blog", desc.ClassName);
            Assert.AreEqual(2, desc.Properties.Count);
            Assert.AreEqual(1, desc.PropertiesRelations.Count);
        }