コード例 #1
0
 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();
 }
コード例 #2
0
 public AddressCodeResult Find(ZipCodeUf uf, string city, string address)
 {
     if (AddressCode.TryParse(uf, city, address, out AddressCode addressCode))
     {
         return(Find(addressCode));
     }
     throw new AddressCodeException();
 }
コード例 #3
0
 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);
 }
コード例 #4
0
        public async Task <AddressCodeResult> FindAsync(AddressCode value)
        {
            string json = await Request.GetStringAsync(GetCreateUrl(value));

            return(GetConvertResult(json));
        }
コード例 #5
0
        public AddressCodeResult Find(AddressCode value)
        {
            string json = Request.GetString(GetCreateUrl(value));

            return(GetConvertResult(json));
        }
コード例 #6
0
 private Uri GetCreateUrl(AddressCode value)
 {
     return(new Uri(string.Format(Url, value.Uf.ToString(), value.City, value.Address)));
 }