Ejemplo n.º 1
0
        public async Task <CarCreated> Handle(RequestCreateCar request, CancellationToken cancellationToken)
        {
            var car = await _carModel.CreateNewCarFromEvent(request);

            var carCreated = CarCreated.From(car);
            await _mediator.Publish(AggregateEvent.Create <RequestCreateCar>(car.Id, carCreated, request));

            await _mediator.Publish(carCreated);

            return(carCreated);
        }