예제 #1
0
        public IActionResult Details(int?id)
        {
            log.Info(nameof(Details));

            if (id == null)
            {
                log.Warn(nameof(Details) + " id is null");

                return(NotFound());
            }

            CarrierDto carrierDto;

            try
            {
                carrierDto = carrierService.Get((int)id);
            }
            catch (Exception e)
            {
                log.Error(e);

                return(BadRequest());
            }

            if (carrierDto == null)
            {
                log.Warn(nameof(Details) + " carrierDto is null");

                return(NotFound());
            }

            return(View(carrierDto));
        }
예제 #2
0
        public IActionResult GetCarrierById([SwaggerParameter("Int", Required = true)] int id)
        {
            log.Info(nameof(GetCarrierById));

            try
            {
                var carrier = carrierService.Get(id);

                if (carrier == null)
                {
                    log.Warn(nameof(GetCarrierById) + " carrier is null");

                    return(NotFound());
                }

                return(Ok(carrier));
            }
            catch (Exception e)
            {
                log.Error(e);

                return(BadRequest());
            }
        }
예제 #3
0
 public Carrier Get(Carrier carrier)
 {
     return(_carrierService.Get(carrier));
 }
예제 #4
0
 public List <CarrierEntity> Get(CarrierSearchEntity CarrierSearchEntity)
 {
     return(CarrierService.Get(EmployeeEntity, CarrierSearchEntity));
 }