private void SaveZip(WebServiceObject result) { Zip zip = new Zip { PostCode = result.PostCode, Country = result.Country, CountryCode = result.CountryCode }; BL.Mangers.ZipManager.SaveZip(zip); foreach (Place i in result.PlaceList) { i.PostCode = zip.PostCode; } }
public async void getZip(string zip) { var rest = RestService.For <GetUsAddress>(BL.WsHandler.RefitConstants.BASE_URL); try { WebServiceObject result = await rest.getZipData(zip); Console.WriteLine(result.PostCode); //Zip zip = result as Zip; List <Place> places = result.PlaceList; SaveZip(result); } catch (Exception e) { Console.WriteLine(e); } }