public ActionResult <PriceReadDTO> PostPrice(int GSid, PriceCreateDTO price) { var priceModel = _mapper.Map <Price>(price); try { _repository.PostPrice(GSid, priceModel); } catch (Exception) { return(NotFound()); } var priceReadDTO = _mapper.Map <PriceReadDTO>(priceModel); return(CreatedAtRoute(nameof(GetPriceById), new { GSid, Pid = priceReadDTO.Id }, priceReadDTO)); }
public ActionResult <PriceCreateDTO> PostPrice(int GSid, int Pid, PriceCreateDTO price) { return(BadRequest()); }