コード例 #1
0
        public IRestResponse SearchAsString(ConsumerViewQuery query, ConsumerViewQuery.ResponseFormat format)
        {
            IRestResponse response = new RestResponse();
            try
            {
                response = Client.Setup(Configuration).Execute(query.CreateRequest(format));
            }
            catch (Exception e)
            {
                LogException(CreateParameters(query), e);
                throw;
            }

            return response;
        }
コード例 #2
0
        public IRestResponse<ConsumerViewResponse> Search(ConsumerViewQuery query)
        {
            IRestResponse<ConsumerViewResponse> response = new RestResponse<ConsumerViewResponse>();
            try
            {
                response = Client.Setup(Configuration).Execute<ConsumerViewResponse>(query.CreateRequest());
            }
            catch (Exception e)
            {
                LogException(CreateParameters(query), e);
                throw;
            }

            return response;
        }
コード例 #3
0
 public when_creating_idnum_query()
 {
     query = new ConsumerViewQuery(Constants.SearchID);
 }
 public override void Observe()
 {
     var query = new ConsumerViewQuery("4810100045085"); // example query
     response = service.Search(query);
 }
コード例 #5
0
 private static string CreateSubCategory(ConsumerViewQuery query)
 {
     return !string.IsNullOrEmpty(query.IdNumber)
         ? "IdNumber" : !string.IsNullOrEmpty(query.PhoneNumber) ? "PhoneNumber" : !string.IsNullOrEmpty(query.EmailAddress) ? "EmailAddress" : "Unknowm";
 }
コード例 #6
0
 private static string CreateParameters(ConsumerViewQuery query)
 {
     return string.Format("ID Number: {0}, Phone number: {1}, Email address: {2}", query.IdNumber, query.PhoneNumber, query.EmailAddress);
 }
コード例 #7
0
 public when_creating_email_query()
 {
     _query = new ConsumerViewQuery("", "", Constants.SearchEmail);
 }
コード例 #8
0
 public when_creating_phone_query()
 {
     query = new ConsumerViewQuery("",Constants.SearchPhone,"");
 }
 public override void Observe()
 {
     //var query = new ConsumerViewQuery { IdNumber = "4810100045085" }; // live example
     var query = new ConsumerViewQuery("4810100045085"); // live example
     response = service.Search(query);
 }
 public when_creating_combined_query_to_search()
 {
     query = new ConsumerViewQuery(Constants.SearchID, Constants.SearchPhone, Constants.SearchEmail);
 }