static void Main(string[] args)
        {
            var apiKey = ExampleUtils.GetApiKey(args);
            var client = new Client(apiKey);
            var query = new PersonQuery
                {
                    FirstName = FirstName,
                    MiddleName = MiddleName,
                    LastName = LastName,
                    City = City,
                    StateCode = StateCode,
                    PostalCode = PostalCode,
                };

            Response<IPerson> response = null;
            try
            {
                response = client.FindPeople(query);

            }
            catch (FindException)
            {
                System.Console.Out.WriteLine("FindPerson lookup for {0}; {1}; {2}; {3}; {4}; {5} failed!", FirstName, MiddleName, LastName, City, StateCode, PostalCode);
            }

            if ((response != null) && (response.IsSuccess))
            {
                var results = response.Results;

                Console.Out.WriteLine( "FindPerson lookup for {0}; {1}; {2}; {3}; {4}; {5} was successful, returning {6} root people objects{7}",
                               FirstName, MiddleName, LastName, City, StateCode, PostalCode, results.Count, System.Environment.NewLine);

                foreach ( var person in results ) {
                    ExampleUtils.DumpPerson( person, 2 );
                    System.Console.Out.WriteLine();
                }
            }

            #if DEBUG
            System.Console.Out.WriteLine("Press the ENTER key to quit...");
            System.Console.In.ReadLine();
            #endif
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad ();
            // Perform any additional setup after loading the view, typically from a nib.

            ConfirmButton.TouchUpInside += (object sender, EventArgs e) => {

                var alert = this.CreateSimpleAlert("Success!", "Your gift recipient was successfully identified.");
                PresentViewController(alert, true, null);
            };

            GoBackButton.TouchUpInside += (object sender, EventArgs e) => {

                NavigationController.PopViewController(true);
            };

            if (!String.IsNullOrWhiteSpace(WhereText)) {
                var apiKey = "<YOUR API KEY HERE>";
                var client = new Client(apiKey);
                var commaParts = WhereText.Split(new [] {','});
                var name = commaParts[0];
                var cityState = commaParts[1];
                var whereParts = cityState.Split(new [] {' '});
                var city = whereParts[0];
                var state = whereParts[1];

                var query = new ProApiLibrary.Api.Queries.PersonQuery(name, city, state, null);
                var response = client.FindPeople(query);
                var results = response.Results;
                var resultCount = (results == null) ? 0 : results.Count;
                if (resultCount <= 0)
                {
                    var alert = CreateSimpleAlert ("No results", "No results were returned from the WhitePages Pro API");
                    PresentViewController (alert, true, null);
                }
                else
                {
                    var best = results [0];
                    var bestName = best.BestName;
                    this.NameLabel.Text = bestName;

                    var location = best.BestLocation;
                    if (location != null)
                    {
                        this.AddressLabel.Text = location.StandardAddressLine1;
                        this.CityLabel.Text = location.City + " " + location.PostalCode;
                    }

                    if (best.PhoneAssociations.Count > 0)
                    {
                        var bestPhone = best.PhoneAssociations [0];
                        if (bestPhone != null)
                        {
                            this.PhoneLabel.Text = bestPhone.Phone.PhoneNumber;
                        }
                    }
                }
            } else {
                this.NavigationController.PopViewController(true);
            }
        }
        public Response<IPerson> SearchProApi(LineItem model)
        {
            var apiKey = ConfigurationManager.AppSettings["api_key"];
            var client = new Client(apiKey);
            var query = new PersonQuery(model.FirstName, null, model.LastName, model.City, model.State, model.PostalCode);
            query.UseHistorical = true;
            query.StreetLine1 = model.StreetAddress1;
            query.StreetLine2 = model.StreetAddress2;
            Response<IPerson> response;
            try
            {
                response = client.FindPeople(query);
            }
            catch (FindException)
            {
                throw new Exception(String.Format("FindPerson lookup for {0} {1} failed!", model.FirstName, model.LastName));
            }

            return response;
        }