예제 #1
0
        public RegistreerPrestatieCommand HandleMaakKlantAanCommand(RegistreerPrestatieCommand command)
        {
            _prestatieRepository.Add(command.Prestatie);

            _eventPublisher.PublishAsync(new PrestatieGeregistreerdEvent
            {
                Prestatie = command.Prestatie
            });

            return(command);
        }
예제 #2
0
        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));
        }