public void Start() { using (NpgsqlConnection connection = _connectionFactory.Create()) { _repository.EnsureTable(connection); InsertContextUsers(connection); _context = null; } }
public void Run() { if (_connection == null) { _connection = _connectionFactory.Create(); } DeleteOldAlarms(); var time = _timeService.UtcTime; _updateAlarmTagsDigitalValues(); ProcessAlarms(time); }
public DateTime Save(LogItem item) { using (var connection = _connectionFactory.Create()) { DeleteOld(connection); if (item.Time == _defaultTime) { item.Time = _timeService.UtcTime; _repository.Insert(connection, item); } else if (!_repository.Update(connection, item)) { _repository.Insert(connection, item); } return(item.Time); } }
public ITrendsRepository Create() { return(new TrendsRepository(_connectionFactory.Create(), _categoryId, _trendTagIds)); }