public ActionResult GetAllEquipmentTypes() { List <EquipmentTypeDTO> equipmentTypesDTO = new List <EquipmentTypeDTO>(); foreach (EquipmentType equipmentType in _equipmentTypeService.GetEquipmentTypes()) { equipmentTypesDTO.Add(EquipmentTypesMapper.EquipmentType_To_EquipmentTypeDTO(equipmentType)); } return(Ok(equipmentTypesDTO)); }
public IActionResult GetEquipmentTypeById(int id) { try { EquipmentType equipmentType = _equipmentTypeService.GetEquipmentTypeById(id); return(Ok(EquipmentTypesMapper.EquipmentType_To_EquipmentTypeDTO(equipmentType))); } catch (DatabaseException e) { return(StatusCode(500, e.Message)); } catch (NotFoundException e) { return(NotFound(e.Message)); } }