示例#1
0
        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));
        }
示例#2
0
 public ActionResult <PriceCreateDTO> PostPrice(int GSid, int Pid, PriceCreateDTO price)
 {
     return(BadRequest());
 }