TypesInfo GetTypesInfo() { var typesInfo = new TypesInfo(); typesInfo.AddEntityStore(new NonPersistentEntityStore(typesInfo)); var xpoSource = new XpoTypeInfoSource(typesInfo); typesInfo.AddEntityStore(xpoSource); XpandModuleBase.Dictiorary = xpoSource.XPDictionary; return typesInfo; }
TypesInfo GetTypesInfo() { var typesInfo = new TypesInfo(); typesInfo.AddEntityStore(new NonPersistentEntityStore(typesInfo)); var xpoSource = new XpoTypeInfoSource(typesInfo); typesInfo.Source = xpoSource; typesInfo.AddEntityStore(xpoSource); return typesInfo; }
TypesInfo GetTypesInfo() { var typesInfo = new TypesInfo(); typesInfo.AddEntityStore(new NonPersistentEntityStore(typesInfo)); var xpoSource = new XpoTypeInfoSource(typesInfo); typesInfo.Source = xpoSource; typesInfo.AddEntityStore(xpoSource); return(typesInfo); }
TypesInfo GetTypesInfo() { var typesInfo = new TypesInfo(); typesInfo.AddEntityStore(new NonPersistentEntityStore(typesInfo)); var xpoSource = new XpoTypeInfoSource(typesInfo); typesInfo.AddEntityStore(xpoSource); XpandModuleBase.Dictiorary = xpoSource.XPDictionary; return(typesInfo); }
public bool Run(RuntimeSetupInfo setupInfo) { var typesInfo = new TypesInfo(); typesInfo.AddEntityStore(new NonPersistentEntityStore(typesInfo)); var reflectionDictionary = new ReflectionDictionary(); reflectionDictionary.CollectClassInfos(typeof(ModuleArtifact).Assembly); var xpoTypeInfoSource = new XpoTypeInfoSource(typesInfo, reflectionDictionary); typesInfo.AddEntityStore(xpoTypeInfoSource); typesInfo.LoadTypes(typeof(ModuleArtifact).Assembly); var exportedTypesFromAssembly = ModuleHelper.CollectExportedTypesFromAssembly(typeof(ModuleArtifact).Assembly, ExportedTypeHelpers.IsExportedType); foreach (var type in exportedTypesFromAssembly) { xpoTypeInfoSource.RegisterEntity(type); } var objectSpace = new XPObjectSpace(typesInfo, xpoTypeInfoSource, () => new UnitOfWork(reflectionDictionary) { ConnectionString = setupInfo.ConnectionString }); if (!objectSpace.Contains <ModuleChild>()) { var moduleTypes = GetModuleTypes(setupInfo); var childModules = objectSpace.GetModuleChilds(moduleTypes); foreach (var childModule in childModules) { childModule.Value.CreateArtifacts(childModule.Key); childModule.Value.CreateExtenderInterfaces(childModule.Key); } UpdateMapViewModule(childModules, objectSpace); } CreateObjects(objectSpace, setupInfo); objectSpace.CommitChanges(); return(true); }
private ValidatorResult ValidateCore(string assemblyPath) { var validatorResult = new ValidatorResult(); try{ using (var typesInfo = new TypesInfo()){ typesInfo.AddEntityStore(new XpoTypeInfoSource(typesInfo)); TypesInfoValidation(assemblyPath, typesInfo); DataStoreValidation(typesInfo); } } catch (Exception e) { var exception = e; if (exception.InnerException != null) { exception = e.InnerException; } validatorResult.Message = Tracing.Tracer.FormatExceptionReport(exception); } return(validatorResult); }
bool ValidateBOModel(IPersistentAssemblyInfo persistentAssemblyInfo, Type compileCore) { if (persistentAssemblyInfo.ValidateModelOnCompile) { try { var typesInfo = new TypesInfo(); typesInfo.AddEntityStore(new NonPersistentEntityStore(typesInfo)); typesInfo.AddEntityStore(new XpoTypeInfoSource(typesInfo)); typesInfo.LoadTypes(compileCore.Assembly); var applicationModulesManager = new ApplicationModulesManager(); applicationModulesManager.AddModule(compileCore); applicationModulesManager.Load(typesInfo, true); } catch (Exception exception) { persistentAssemblyInfo.CompileErrors = exception.ToString(); return false; } } return true; }
public bool Run(RuntimeSetupInfo setupInfo) { var typesInfo = new TypesInfo(); typesInfo.AddEntityStore(new NonPersistentEntityStore(typesInfo)); var reflectionDictionary = new ReflectionDictionary();reflectionDictionary.CollectClassInfos(typeof(ModuleArtifact).Assembly); var xpoTypeInfoSource = new XpoTypeInfoSource(typesInfo,reflectionDictionary); typesInfo.AddEntityStore(xpoTypeInfoSource); typesInfo.LoadTypes(typeof(ModuleArtifact).Assembly); var exportedTypesFromAssembly = ModuleHelper.CollectExportedTypesFromAssembly(typeof(ModuleArtifact).Assembly,ExportedTypeHelpers.IsExportedType); foreach (var type in exportedTypesFromAssembly){ xpoTypeInfoSource.RegisterEntity(type); } var objectSpace = new XPObjectSpace(typesInfo, xpoTypeInfoSource, () => new UnitOfWork(reflectionDictionary){ ConnectionString = setupInfo.ConnectionString }); if (!objectSpace.Contains<ModuleChild>()){ var moduleTypes = GetModuleTypes(setupInfo); var childModules = objectSpace.GetModuleChilds(moduleTypes); foreach (var childModule in childModules){ childModule.Value.CreateArtifacts(childModule.Key); childModule.Value.CreateExtenderInterfaces(childModule.Key); } UpdateMapViewModule(childModules, objectSpace); } CreateObjects(objectSpace, setupInfo); objectSpace.CommitChanges(); return true; }