public void Update(Guid readingId) { var lastSeenLog = new LastSeenLog() { LastSeenAt = DateTime.UtcNow, ReadingId = readingId }; _lastSeenLogService.AddOrUpdateAsync(lastSeenLog); }
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(); } }
public async Task AddOrUpdateAsync(LastSeenLog liveRaceViewModel) { await _lastSeenLogRepository.SaveAsync(liveRaceViewModel); }
public void Update(LastSeenLog lastSeenLog) { _lastSeenLogService.AddOrUpdateAsync(lastSeenLog); }