Example #1
0
 public override void CustomizeTypesInfo(DevExpress.ExpressApp.DC.ITypesInfo typesInfo)
 {
     base.CustomizeTypesInfo(typesInfo);
     if (_existentTypesMemberCreator == null && RuntimeMode && (!string.IsNullOrEmpty(ConnectionString) || Application.ObjectSpaceProvider is DataServerObjectSpaceProvider))
     {
         AddToAdditionalExportedTypes("Xpand.Persistent.BaseImpl.PersistentMetaData");
         WCTypesInfo.Instance.Register(GetAdditionalClasses(ModuleManager));
         _existentTypesMemberCreator = new ExistentTypesMemberCreator();
         var session = Application.FindModule <WorldCreatorModuleBase>().GetUnitOfWork();
         _existentTypesMemberCreator.CreateMembers(session, typesInfo);
     }
 }
Example #2
0
        protected override IEnumerable <Type> GetDeclaredExportedTypes()
        {
            var existentTypesMemberCreator = new ExistentTypesMemberCreator();

            if (FullConnectionString != null)
            {
                var xpoMultiDataStoreProxy = new MultiDataStoreProxy(FullConnectionString, GetReflectionDictionary());
                var simpleDataLayer        = new SimpleDataLayer(xpoMultiDataStoreProxy);
                var session = new Session(simpleDataLayer);
                existentTypesMemberCreator.CreateMembers(session);
            }
            return(base.GetDeclaredExportedTypes());
        }
Example #3
0
        public override void CustomizeTypesInfo(ITypesInfo typesInfo)
        {
            base.CustomizeTypesInfo(typesInfo);
            AddToAdditionalExportedTypes(BaseImplNameSpace);
            if (RuntimeMode)
            {
                var classInfos = XpoTypesInfoHelper.GetXpoTypeInfoSource().XPDictionary.Classes.OfType <XPClassInfo>()
                                 .Where(info => info.IsPersistent &&
                                        WorldCreatorTypeInfoSource.Instance.RegisteredEntities.Contains(info.ClassType));
                foreach (var xpClassInfo in classInfos)
                {
                    xpClassInfo.AddAttribute(new NonPersistentAttribute());
                }

                ExistentTypesMemberCreator.CreateMembers(this);
            }
        }