Ex2 (integrado): decorator de cache para IWorkshopRepository + TTL por Options
This commit is contained in:
12
Services/PerRequestClock.cs
Normal file
12
Services/PerRequestClock.cs
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user