public async Task <IActionResult> ExecuteAsync(SaveOffer saveOffer, CancellationToken cancellationToken) { var offer = this._saveOfferToOfferMapper.Map(saveOffer); offer = await this._offerRepository.Update(offer, cancellationToken); var offerViewModel = this._offerToOfferMapper.Map(offer); return(new CreatedAtRouteResult( OffersControllerRoute.GetOffer, new { offerId = offerViewModel.OfferId }, offerViewModel)); }
public Task <IActionResult> Post( [FromServices] IPostOfferCommand command, [FromBody] SaveOffer offer, CancellationToken cancellationToken) => command.ExecuteAsync(offer);