Пример #1
0
        public async Task <ActionResult <CostCenterVM> > GetCostCenter(int id)
        {
            try
            {
                var result = await costcenterRepository.GetCostCenter(id);

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

                return(result);
            }
            catch (DbUpdateException Ex)
            {
                return(StatusCode(StatusCodes.Status500InternalServerError,
                                  Ex.InnerException.Message));
            }
        }
        public async Task <ActionResult <CostCenter> > GetCostCenter(int id)
        {
            try
            {
                var result = await costCenterRepository.GetCostCenter(id);

                if (result == null)
                {
                    return(NotFound());
                }
                return(result);
            }
            catch (Exception)
            {
                return(StatusCode(StatusCodes.Status500InternalServerError,
                                  "Data not found database"));
            }
        }