public ActionResult <GetCustomerbyID> GetCustomerById(int customerID) { try { var result = _repository.GetCustomerById(customerID); IMapper mapper = EDeliveryProfile.GetCustomerByID(); return(mapper.Map <GetCustomerbyID>(result)); } catch (Exception ex) { _logger.LogError($"Failed to get the Customer by ID:{ex}"); return(BadRequest("Failed to get the Customer by ID")); } }