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);
        }
Example #2
0
 public async Task <Digimon?> Handle(GetDigimonByIdQuery request, CancellationToken cancellationToken) =>
 await digimonRepository.GetDigimonById(request.Id);