public async Task <Unit> Handle(UpdateDigimonCommand request, CancellationToken cancellationToken) { var digimon = await digimonRepository.GetDigimonById(request.Id); if (digimon != null) { digimon.Update(request.Nom, request.Niveau, clock.GetCurrentInstant()); await digimonRepository.Update(digimon); } return(Unit.Value); }
public async Task <Digimon?> Handle(GetDigimonByIdQuery request, CancellationToken cancellationToken) => await digimonRepository.GetDigimonById(request.Id);