protected TStorageAdapter GetAdapter <TStorageAdapter>() where TStorageAdapter : class, IStorageAdapter { if (_adapter == null) { _adapter = _container.Resolve <TStorageAdapter>(); _adapter.Install = _install; _adapter.Initialize(); } return((TStorageAdapter)_adapter); }
private void InitializeDatabase() { EnsureDatabaseDirectoryExists(); try { _storageAdapter.Initialize(_databasePath); _storageAdapter.CreateTable(TableName, new[] { ColumnIdName, ColumnChannelName, ColumnLogName }, new[] { "INTEGER PRIMARY KEY AUTOINCREMENT", "TEXT NOT NULL", "TEXT NOT NULL" }); } catch (Exception e) { AppCenterLog.Error(AppCenterLog.LogTag, "An error occurred while initializing storage", e); } }