Пример #1
0
 public DataSource(string name, Database database, CacheSettings cacheSettings = null)
 {
     Database = database;
       App = Database.DbModel.EntityApp;
       Name = database.Settings.DataSourceName;
       if(cacheSettings != null && cacheSettings.HasTypes())
     Cache = new EntityCache(App, cacheSettings, this.Database);
 }
Пример #2
0
 public EntityCache(EntityApp app, CacheSettings settings, Database database)
 {
     _app = app;
       Settings = settings;
       _dataStore = database;
       _sparseCache = new SparseEntityCache(Settings);
       var dbIsCaseInsensitive = database.Settings.Driver.Features.IsSet(Data.Driver.DbFeatures.DefaultCaseInsensitive);
       var caseMode = dbIsCaseInsensitive ? StringCaseMode.CaseInsensitive : StringCaseMode.CaseSensitive;
       _fullSetCache = new FullSetEntityCache(_app, Settings, _dataStore, caseMode);
       _timeService = _app.GetService<ITimeService>();
       _logService = _app.GetService<IOperationLogService>();
       _errorLog = _app.GetService<IErrorLogService>();
       MarkCachedEntities();
       _app.AppEvents.SavedChanges += Events_SavedChanges;
 }
Пример #3
0
 public SparseEntityCache(CacheSettings settings)
 {
     _settings = settings;
       _cacheTable = new ObjectCache<CachedRecordData>("SparseEntityCache", _settings.SparseCacheExpirationSec);
 }