┌──────────────┐ ┌──────────────┐ ┌───────────────────────┐
│ Controller │──────▶│ MediatR │──────▶│ CreateProdutoHandler │
└──────────────┘ └──────────────┘ └──────────────┬────────┘
│
│ injeta
▼
┌──────────────────────────┐
│ IProdutoRepository │
│ (Decorator registrado) │
└──────────────┬───────────┘
│
│ chama internamente
▼
┌─────────────────────────────────────────────┐
│ ProdutoRepositoryCacheDecorator │
│ - Atualiza cache Redis │
│ - Encaminha operação ao repositório real │
└─────────────────┬───────────────────────────┘
│
│ chama
▼
┌─────────────────────────────────────────────┐
│ ProdutoRepository │
│ - Usa EF Core │
│ - Salva no banco SQL │
└─────────────────┬───────────────────────────┘
│
│ commit
▼
┌─────────────────────────────────────────────┐
│ UnitOfWork │
│ - SaveChangesAsync │
│ - CommitAsync transaction │
└─────────────────────────────────────────────┘
wesleyfariasdev/dotnet-cache-examplo
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|