예제 #1
0
 public void Start()
 {
     using (NpgsqlConnection connection = _connectionFactory.Create()) {
         _repository.EnsureTable(connection);
         InsertContextUsers(connection);
         _context = null;
     }
 }
예제 #2
0
        public void Run()
        {
            if (_connection == null)
            {
                _connection = _connectionFactory.Create();
            }
            DeleteOldAlarms();
            var time = _timeService.UtcTime;

            _updateAlarmTagsDigitalValues();
            ProcessAlarms(time);
        }
예제 #3
0
 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);
     }
 }
예제 #4
0
 public ITrendsRepository Create()
 {
     return(new TrendsRepository(_connectionFactory.Create(), _categoryId, _trendTagIds));
 }