示例#1
0
        public SimpleDataLayer GetDataLayer(XPDictionary xpDictionary, MultiDataStore multiDataStore,Type type) {
            string connectionString = multiDataStore.DataStoreManager.GetConnectionString(type);
            var xpoDataStoreProxy = new DataStoreProxy(connectionString);
            xpoDataStoreProxy.DataStoreModifyData+=(o, eventArgs) => multiDataStore.ModifyData(eventArgs);            
            xpoDataStoreProxy.DataStoreSelectData+=(sender1, dataEventArgs) => {
                if (multiDataStore.DataStoreManager.SimpleDataLayers.Count>1&&IsQueryingXPObjectType(dataEventArgs)) {
                    createExcludeXPObjectTypeArgs(dataEventArgs.SelectStatements,xpDictionary);
                }
                multiDataStore.SelectData(dataEventArgs);
            };
            xpoDataStoreProxy.DataStoreUpdateSchema +=(o1, schemaEventArgs) => multiDataStore.UpdateSchema(schemaEventArgs);
            return new SimpleDataLayer(xpDictionary, xpoDataStoreProxy);

        }
示例#2
0
        public SimpleDataLayer GetDataLayer(XPDictionary xpDictionary, MultiDataStore multiDataStore, Type type)
        {
            string connectionString  = multiDataStore.DataStoreManager.GetConnectionString(type);
            var    xpoDataStoreProxy = new DataStoreProxy(connectionString);

            xpoDataStoreProxy.DataStoreModifyData += (o, eventArgs) => multiDataStore.ModifyData(eventArgs);
            xpoDataStoreProxy.DataStoreSelectData += (sender1, dataEventArgs) => {
                if (multiDataStore.DataStoreManager.SimpleDataLayers.Count > 1 && IsQueryingXPObjectType(dataEventArgs))
                {
                    createExcludeXPObjectTypeArgs(dataEventArgs.SelectStatements, xpDictionary);
                }
                multiDataStore.SelectData(dataEventArgs);
            };
            xpoDataStoreProxy.DataStoreUpdateSchema += (o1, schemaEventArgs) => multiDataStore.UpdateSchema(schemaEventArgs);
            return(new SimpleDataLayer(xpDictionary, xpoDataStoreProxy));
        }