コード例 #1
0
        public ActionResult <TruckDTO> PostTruck(TruckForCreationDTO truckForCreation)
        {
            var truckToReturn = _logicRepository.CreateTruck(truckForCreation);

            _logicRepository.Save();

            return(Ok(truckToReturn));
        }
コード例 #2
0
        public ActionResult <TruckDTO> PostTruck(TruckForCreationDTO truckForCreation)
        {
            //if(ModelState.IsValid)
            //{
            //    var truckToReturn = _logicRepository.CreateTruck(truckForCreation);
            //    _logicRepository.Save();

            //    return Ok(truckToReturn);
            //}
            //return Ok();
            var truckToReturn = _logicRepository.CreateTruck(truckForCreation);

            _logicRepository.Save();

            return(Ok(truckToReturn));
        }