Exemple #1
0
        public async Task <bool> Read(int id)
        {
            try
            {
                HttpResponseMessage responseMessage = await client.GetAsync(string.Format("{0}/{1}/{2}", url, "servicio-asociado", id));

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

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

                throw;
            }
        }
Exemple #2
0
 private void MappingThisFromAnother(Servicio_Asociado_Web objeto)
 {
     this.Id       = objeto.Id;
     this.Servicio = objeto.Servicio;
     this.Contrato = objeto.Contrato;
 }