Esempio n. 1
0
        public EntityStorage(string pEntityTypeName)
        {
            _storageEntityTypeName = pEntityTypeName;


            _entityStorageDir = EntityStorage.GenerateAbsStorageLocation(
                Context.Params.P <string>(AppParams.P_ENTITY_DIR),
                _storageEntityTypeName);

            Context.Log.Debug("{0} Storing {1} entities into {2}", _logHeader, _storageEntityTypeName, _entityStorageDir);
            lock (_storageLock)
            {
                if (!Directory.Exists(_entityStorageDir))
                {
                    try
                    {
                        Directory.CreateDirectory(_entityStorageDir);
                    }
                    catch (Exception e)
                    {
                        Context.Log.Error("{0} Failure creating storage directory {1}: {2}",
                                          _logHeader, _entityStorageDir, e);
                    }
                }
            }
        }
Esempio n. 2
0
 public EntityMem(EntityStorage pStorageSystem)
 {
     _storageSystem = pStorageSystem;
 }