Пример #1
0
        public void Update(Guid readingId)
        {
            var lastSeenLog = new LastSeenLog()
            {
                LastSeenAt = DateTime.UtcNow,
                ReadingId  = readingId
            };

            _lastSeenLogService.AddOrUpdateAsync(lastSeenLog);
        }
Пример #2
0
        public async Task SaveAsync(LastSeenLog lastSeenLog)
        {
            if (lastSeenLog != null)
            {
                var dbEntry = _context
                              .LastSeenLogs
                              .FirstOrDefault(x => x.ReadingId == lastSeenLog.ReadingId);

                if (dbEntry != null)
                {
                    dbEntry.LastSeenAt = lastSeenLog.LastSeenAt;
                }

                if (dbEntry == null)
                {
                    _context.LastSeenLogs.Add(lastSeenLog);
                }

                await _context.SaveChangesAsync();
            }
        }
Пример #3
0
 public async Task AddOrUpdateAsync(LastSeenLog liveRaceViewModel)
 {
     await _lastSeenLogRepository.SaveAsync(liveRaceViewModel);
 }
Пример #4
0
 public void Update(LastSeenLog lastSeenLog)
 {
     _lastSeenLogService.AddOrUpdateAsync(lastSeenLog);
 }