コード例 #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));
 }