예제 #1
0
 private void MappingThisFromAnother(Seguro_Asociado_Web objeto)
 {
     this.Id          = objeto.Id;
     this.Valor       = objeto.Valor;
     this.Tipo_Seguro = objeto.Tipo_Seguro;
     this.Total_Dias  = objeto.Total_Dias;
     this.Seguro      = objeto.Seguro;
     this.Contrato    = objeto.Contrato;
 }
예제 #2
0
        public async Task <bool> Read(int id)
        {
            try
            {
                HttpResponseMessage responseMessage = await client.GetAsync(string.Format("{0}/{1}/{2}", url, "seguro-asociado", id));

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

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

                throw;
            }
        }