public async Task <AddressCodeResult> FindAsync(ZipCodeUf uf, string city, string address) { if (AddressCode.TryParse(uf, city, address, out AddressCode addressCode)) { return(await FindAsync(addressCode)); } throw new AddressCodeException(); }
public AddressCodeResult Find(ZipCodeUf uf, string city, string address) { if (AddressCode.TryParse(uf, city, address, out AddressCode addressCode)) { return(Find(addressCode)); } throw new AddressCodeException(); }
public static bool TryParse(ZipCodeUf uf, string city, string address, out AddressCode addressCode) { if (Valid(uf.ToString(), city, address)) { addressCode = new AddressCode(uf, city, address); return(true); } addressCode = null; return(false); }
public async Task <AddressCodeResult> FindAsync(AddressCode value) { string json = await Request.GetStringAsync(GetCreateUrl(value)); return(GetConvertResult(json)); }
public AddressCodeResult Find(AddressCode value) { string json = Request.GetString(GetCreateUrl(value)); return(GetConvertResult(json)); }
private Uri GetCreateUrl(AddressCode value) { return(new Uri(string.Format(Url, value.Uf.ToString(), value.City, value.Address))); }