Exemple #1
0
        private ElectionsResource.VoterInfoQueryRequest SetUpVoterQueryRequest(string streetAddress, long electionId)
        {
            CivicInfoService service = new CivicInfoService(new BaseClientService.Initializer {
                ApplicationName = "ExcelToObjects",
                ApiKey          = _apiKey
            });
            var voterQueryRequest = new ElectionsResource.VoterInfoQueryRequest(service, streetAddress);

            voterQueryRequest.ElectionId = electionId;
            return(voterQueryRequest);
        }
 public async Task<VoterInfoResponse> GetVoterInfoByAddress(string address, int electionId = 2000)
 {
     var voterInfoRequest = new ElectionsResource.VoterInfoQueryRequest(_service, address) { ElectionId = electionId };
     return await voterInfoRequest.ExecuteAsync();
 }