Esempio n. 1
0
        public IPersistentAssemblyInfo Build(string customer, string order, string orderLine, string masterDetailDynamicAssembly)
        {
            var objectSpace = new XPObjectSpace(XafTypesInfo.Instance, XpandModuleBase.XpoTypeInfoSource, () => new UnitOfWork(_session.DataLayer));
            var persistentAssemblyBuilder      = PersistentAssemblyBuilder.BuildAssembly(objectSpace, masterDetailDynamicAssembly);
            IClassInfoHandler classInfoHandler = persistentAssemblyBuilder.CreateClasses(GetClassNames(customer, order, orderLine));

            classInfoHandler.CreateTemplateInfos(persistentClassInfo => GetTemplateInfos(persistentClassInfo, customer, order));
            classInfoHandler.SetInheritance(info => GetInheritance(info));
            classInfoHandler.CreateReferenceMembers(classInfo => GetReferenceMembers(classInfo, customer, order, orderLine), true);
            objectSpace.CommitChanges();
            return(persistentAssemblyBuilder.PersistentAssemblyInfo);
        }
Esempio n. 2
0
 PersistentAssemblyBuilder GetPersistentAssemblyBuilder()
 {
     _XPObjectSpace = (XPObjectSpace)ObjectSpaceInMemory.CreateNew();
     return(PersistentAssemblyBuilder.BuildAssembly(_XPObjectSpace, "a" + Guid.NewGuid().ToString().Replace("-", "")));
 }