private static async Task TestZipCodeRetriever() { string GoogleApiKey = Configuration.GetValue <string>("GoogleApiKey"); ZipCodeRetrieverService zipRetriever = new ZipCodeRetrieverService(GoogleApiKey); string myAddress = "225 e 17th street, new york ny"; string myZip = await zipRetriever.GetZip(myAddress); Console.WriteLine($"Full Address is {myAddress} {myZip}"); }
public async Task <string> GetZipFromMemberAddress(Member member) { string zip = member.ZipCode; if (member.ContainsFullAddressAndNoZip()) { string fullMemberAddress = member.GetFullAddress(); zip = await _zipRetrieverService.GetZip(fullMemberAddress); } return(zip); }