Example #1
0
        public async Task <bool> ReadPorRut(int rut)
        {
            try
            {
                HttpResponseMessage responseMessage = await client.GetAsync(string.Format("{0}/{1}/{2}", url, "apoderado", rut));

                if (responseMessage.IsSuccessStatusCode)
                {
                    var           responseData = responseMessage.Content.ReadAsStringAsync().Result;
                    Apoderado_Web retorno      = JsonConvert.DeserializeObject <Apoderado_Web>(responseData);

                    MappingThisFromAnother(retorno);
                    return(true);
                }
                return(false);
            }
            catch (Exception)
            {
                return(false);

                throw;
            }
        }
Example #2
0
 public void MappingThisFromAnother(Apoderado_Web objeto)
 {
     this.Id      = objeto.Id;
     this.Usuario = objeto.Usuario;
 }