More Polish (#4336)

Co-authored-by: Amelia <77553571+Fesaa@users.noreply.github.com>
This commit is contained in:
Joe Milazzo
2026-01-10 10:06:52 -07:00
committed by GitHub
parent aed86b9754
commit dec65b9262
38 changed files with 4949 additions and 148 deletions
+24
View File
@@ -0,0 +1,24 @@
using System;
using System.Linq;
using System.Threading.Tasks;
using API.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
namespace API.Services;
public interface IAuthKeyService
{
Task UpdateLastAccessedAsync(string authKey);
}
public class AuthKeyService(DataContext context, ILogger<AuthKeyService> logger) : IAuthKeyService
{
public async Task UpdateLastAccessedAsync(string authKey)
{
logger.LogTrace("Updating last accessed Auth key: {AuthKey}", authKey);
await context.AppUserAuthKey
.Where(k => k.Key == authKey)
.ExecuteUpdateAsync(s => s.SetProperty(k => k.LastAccessedAtUtc, DateTime.UtcNow));
}
}