public async Task <ActionResult <BasketREST> > PostBasket(BasketREST basketREST) { var basketModel = Mapper.Map <Basket>(basketREST); var success = await BasketService.CreateAsync(basketModel); if (!success) { return(StatusCode(500)); } return(Ok(success)); }
public async Task <ActionResult <bool> > PutBasket(Guid id, BasketREST basketREST) { if (id != basketREST.Id) { return(BadRequest()); } var basketModel = Mapper.Map <Basket>(basketREST); bool success = await BasketService.UpdateAsync(id, basketModel); if (!success) { return(NoContent()); } return(Ok(success)); }