Beispiel #1
0
        public async Task <ActionResult <Dto.CoffeeRoastingEvent> > CreateCoffeeRoastingEvent(
            [FromBody] Dto.CoffeeRoastingEventPostRequest request, CancellationToken cancellationToken)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var cmd         = _mapper.Map(request);
            var domainEvent = await _mediator.Send(cmd, cancellationToken);

            return(_mapper.Map(domainEvent));
        }
 public CreateCoffeeRoastingEventCommand Map(Dto.CoffeeRoastingEventPostRequest request) => new()