Пример #1
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;
 }
Пример #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;
        }