public ProductTypeDTO GetProductTypeById(int productTypeId) { return(mapper.Map <ProductType, ProductTypeDTO>(_productTypeRepository.GetProductTypeById(productTypeId))); }
public async Task <ActionResult <ProductType> > GetProductTypeById(int id) { var product = await _repository.GetProductTypeById(id); return(Ok(product ?? new ProductType(id))); }