public ActionResult <TruckDTO> PostTruck(TruckForCreationDTO truckForCreation) { var truckToReturn = _logicRepository.CreateTruck(truckForCreation); _logicRepository.Save(); return(Ok(truckToReturn)); }
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)); }