Files
Govor/Govor.Application/Users/UserOnlineStatus/UserPresenceReader.cs
Artemy 2d99c57a3b Expand server tests and enforce coverage
Consolidate server tests under tests/, upgrade them to .NET 10, and add CI coverage thresholds and reports. Expand API and application boundary coverage while fixing related issues in media handling, friend blocking, session crypto, presence, username validation, and local storage.
2026-10-24 15:30:32 +07:00

14 lines
405 B
C#

using Govor.Domain;
using Microsoft.EntityFrameworkCore;
namespace Govor.Application.Users.UserOnlineStatus;
public class UserPresenceReader(GovorDbContext context) : IUserPresenceReader
{
public Task<DateTime?> GetLastSeenAsync(Guid userId)
{
return context.Users.AsNoTracking().Where(u => u.Id == userId)
.Select(u => (DateTime?)u.WasOnline).FirstOrDefaultAsync();
}
}