Example #1
0
        public async Task <IEnumerable <OrderDto> > Handle(CreateManyOrder request, CancellationToken cancellationToken)
        {
            var command = await repository.CreateMany(request.items);

            return(mapper.Map <IEnumerable <OrderDto> >(command));
        }
Example #2
0
      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));
      }