Ex2 (integrado): decorator de cache para IWorkshopRepository + TTL por Options

This commit is contained in:
Arthur Faria
2025-10-14 19:44:18 -03:00
parent 047c1a7ddb
commit fc6f5fd1de
8 changed files with 222 additions and 2 deletions

View File

@@ -0,0 +1,12 @@
namespace CampusWorkshops.Api.Services;
public interface IPerRequestClock
{
// Carimbo criado no CONSTRUTOR (não muda depois)
DateTimeOffset CreatedAt { get; }
}
public sealed class PerRequestClock : IPerRequestClock
{
public DateTimeOffset CreatedAt { get; } = DateTimeOffset.UtcNow;
}