POO Avancée & Architecture Logicielle avec C#
Le modèle TAP
Task représente un travail potentiellement futur.
async / await transforme le code en machine à états compilée.
- Le bénéfice principal est la non-blocage des threads, pas la magie de performance.
public async Task<Reservation?> FindAsync(Guid id, CancellationToken ct)
{
await Task.Delay(10, ct);
return await repository.GetByIdAsync(id, ct);
}