Ejemplo n.º 1
0
        public IActionResult GetProductionArea(Guid id)
        {
            var productionArea = _productionAreaRepository.GetProductionAreaById(id);

            if (productionArea == null)
            {
                return(NotFound());
            }

            var productionAreaToGet = _mapper.Map <ProductionAreaToGet>(productionArea);

            return(Ok(productionAreaToGet));
        }
        public IActionResult GetProductionArea(Guid productionAreaId)
        {
            if (productionAreaId == null || productionAreaId == Guid.Empty)
            {
                return(BadRequest());
            }


            var productionArea = _productionAreaRepository.GetProductionAreaById(productionAreaId);

            if (EqualityComparer <ProductionArea> .Default.Equals(productionArea, default(ProductionArea)))
            {
                return(NotFound());
            }

            var productionAreaTO = _mapper.Map <ProductionAreaTO>(productionArea);

            return(Ok(productionAreaTO));
        }