Esempio n. 1
0
 public IActionResult CreateVehicleType([FromBody] CreateVehicleTypeDto vehicleTypeDto)
 {
     if (!ModelState.IsValid)
     {
         return(BadRequest(ModelState));
     }
     try
     {
         _vehicleService.CreateVehicleType(vehicleTypeDto);
     }
     catch (Exception)
     {
         return(BadRequest("Invalid details entered"));
     }
     return(Ok());
 }
Esempio n. 2
0
 public void CreateVehicleType(CreateVehicleTypeDto vehicleTypeDto)
 {
     _repositoryFactory.VehicleRepository.SaveVehicleType(_mapper.Map <VehicleType>(vehicleTypeDto));
     _logger.LogInformation("Vehicle type created");
 }