Ejemplo n.º 1
0
        public Response <Customer> GetCustomerInfo(GetCustomerByCustomerIdRequest request)
        {
            Response <Customer> response = new Response <Customer>();

            if (request == null)
            {
                ArgumentNullException ex = new ArgumentNullException("GetCustomerInfo request");
                LogError(ex);
                response.ErrorCode = ErrorCode.Argument;
                response.Exception = ex;
                return(response);
            }

            CustomerAccessor accessor = new CustomerAccessor();

            try
            {
                response.Result    = accessor.GetCustomerById(request.CustomerID);
                response.IsSuccess = true;
            }
            catch (Exception ex)
            {
                LogError(ex);
                response.IsSuccess = false;
                response.ErrorCode = ErrorCode.Technical;
            }

            return(response);
        }