public RegistreerPrestatieCommand HandleMaakKlantAanCommand(RegistreerPrestatieCommand command) { _prestatieRepository.Add(command.Prestatie); _eventPublisher.PublishAsync(new PrestatieGeregistreerdEvent { Prestatie = command.Prestatie }); return(command); }
public async Task <IActionResult> Add(Prestatie prestatie) { prestatie.Datum = DateTime.Now; prestatie.KlantId = GetKlantIdFromToken(); var command = new RegistreerPrestatieCommand { Prestatie = prestatie }; var result = await _commandPublisher.PublishAsync <RegistreerPrestatieCommand>(command); return(Ok(result.Prestatie)); }