示例#1
0
 bool TypeExists(DataStoreManagerSimpleDataLayer dataLayer, InsertStatement stm1) {
     if (dataLayer.IsMainLayer)
         return false;
     var session = new Session(dataLayer) { IdentityMapBehavior = IdentityMapBehavior.Strong };
     var value = stm1.Parameters.ToList()[0].Value as string;
     var xpObjectType = session.FindObject<XPObjectType>(type => type.TypeName == value);
     return xpObjectType != null;
 }
示例#2
0
 public DataStoreManagerSimpleDataLayer GetDataLayer(string key, IDataStore defaultStore)
 {
     if (!_simpleDataLayers.ContainsKey(key))
     {
         var keyValuePair       = _reflectionDictionaries.First(info => info.Key.Key == key);
         var connectionProvider = keyValuePair.Key.Key == DefaultDictionaryKey?defaultStore:GetConnectionProvider(keyValuePair.Key.Key);
         var simpleDataLayer    = new DataStoreManagerSimpleDataLayer(keyValuePair.Value, connectionProvider,
                                                                      keyValuePair.Key.Key == DefaultDictionaryKey, keyValuePair.Key.IsLegacy);
         _simpleDataLayers.Add(keyValuePair.Key.Key, simpleDataLayer);
     }
     return(_simpleDataLayers[key]);
 }
示例#3
0
 ReflectionDictionary GetDictionary(KeyInfo keyInfo)
 {
     if (!_reflectionDictionaries.ContainsKey(keyInfo.Key))
     {
         var reflectionDictionary = new ReflectionDictionary();
         _reflectionDictionaries.Add(keyInfo.Key, reflectionDictionary);
         var simpleDataLayer = new DataStoreManagerSimpleDataLayer(reflectionDictionary, GetConnectionProvider(keyInfo.Key), keyInfo.Key == StrDefault, keyInfo.IsLegacy);
         _simpleDataLayers.Add(keyInfo.Key, simpleDataLayer);
         _tables.Add(keyInfo.Key, new List <string>());
     }
     return(_reflectionDictionaries[keyInfo.Key]);
 }
示例#4
0
 ReflectionDictionary GetDictionary(KeyInfo keyInfo) {
     if (!_reflectionDictionaries.ContainsKey(keyInfo.Key)) {
         var reflectionDictionary = new ReflectionDictionary();
         _reflectionDictionaries.Add(keyInfo.Key, reflectionDictionary);
         var simpleDataLayer = new DataStoreManagerSimpleDataLayer(reflectionDictionary, GetConnectionProvider(keyInfo.Key), keyInfo.Key == StrDefault, keyInfo.IsLegacy);
         _simpleDataLayers.Add(keyInfo.Key, simpleDataLayer);
         _tables.Add(keyInfo.Key, new List<string>());
     }
     return _reflectionDictionaries[keyInfo.Key];
 }
示例#5
0
 public DataStoreManagerSimpleDataLayer GetDataLayer(string key,IDataStore defaultStore){
     if (!_simpleDataLayers.ContainsKey(key)){
         var keyValuePair = _reflectionDictionaries.First(info => info.Key.Key==key);
         var connectionProvider = keyValuePair.Key.Key==StrDefault?defaultStore:GetConnectionProvider(keyValuePair.Key.Key);
         var simpleDataLayer = new DataStoreManagerSimpleDataLayer(keyValuePair.Value, connectionProvider,
             keyValuePair.Key.Key == StrDefault, keyValuePair.Key.IsLegacy);
         _simpleDataLayers.Add(keyValuePair.Key.Key, simpleDataLayer);
     }
     return _simpleDataLayers[key];
 }