Ejemplo n.º 1
0
 public static SimpleDataLayer GetDataLayer(string connectionString, XPDictionary xpDictionary, Type type) {
     var dummyProxy = new XpoMultiDataStoreProxy(connectionString,xpDictionary);
     connectionString = dummyProxy.DataStoreManager.GetConnectionString(type);
     var xpoDataStoreProxy = new XpoDataStoreProxy(connectionString);
     xpoDataStoreProxy.DataStoreModifyData += (o, eventArgs) => dummyProxy.ModifyData(eventArgs.ModificationStatements);
     xpoDataStoreProxy.DataStoreSelectData += (sender1, dataEventArgs) => {
         if (dummyProxy.DataStoreManager.SimpleDataLayers.Count > 1 && dummyProxy.IsQueryingXPObjectType(dataEventArgs)){
             dummyProxy.CreateExcludeXPObjectTypeArgs(dataEventArgs.SelectStatements, xpDictionary);
         }
         dummyProxy.SelectData(dataEventArgs.SelectStatements);
     };
     xpoDataStoreProxy.DataStoreUpdateSchema +=
         (o1, schemaEventArgs) => dummyProxy.UpdateSchema(schemaEventArgs.DontCreateIfFirstTableNotExist, schemaEventArgs.Tables);
     return new SimpleDataLayer(xpDictionary, xpoDataStoreProxy);
 }
Ejemplo n.º 2
0
 public DataStoreProvider(string connectionString)
 {
     connectionStringCore = connectionString;
     proxyCore = new XpoDataStoreProxy(connectionString);
 }