public async Task <IEnumerable <WhilistBasketDto> > Handle(CreateManyWhilistBasket request, CancellationToken cancellationToken) { var command = await repository.CreateMany(request.items); return(mapper.Map <IEnumerable <WhilistBasketDto> >(command)); }
public async Task <IActionResult> CreateMany([FromBody] CreateManyWhilistBasket command) { var result = await mediator.Send(command); return(CreatedAtAction("CreateManyWhilistBasket", new { x = result.SelectMany(x => x.baskets).ToList(), result })); }