public async Task <IEnumerable <OrderDto> > Handle(CreateManyOrder request, CancellationToken cancellationToken) { var command = await repository.CreateMany(request.items); return(mapper.Map <IEnumerable <OrderDto> >(command)); }
public async Task <IActionResult> CreateMany([FromBody] CreateManyOrder command) { var result = await mediator.Send(command); return(CreatedAtAction("GetOrder", new { ordersId = result.Select(x => x.id) }, result)); }