コード例 #1
0
ファイル: ContactWs.cs プロジェクト: binhara/cuidabrasil
        public async Task <ObservableCollection <Contact> > Contacts()
        {
            try
            {
                var result = await ObjClient.PhonebookContactsGetAsync(new CancellationToken());

                return(result);
            }
            catch (HttpRequestException ex)
            {
                ObjSuccessfulAnswer = new SuccessfulAnswer()
                {
                    TitleMessage = "Ops, erro ao listar o cadastro!", Message = ex.Message, Success = false
                };
                return(null);
            }
            catch (SwaggerException ex)
            {
                ObjSuccessfulAnswer = new SuccessfulAnswer()
                {
                    TitleMessage = "Ops, erro ao lista o  cadastro!", Message = JsonConvert.DeserializeObject <SuccessfulAnswer>(ex.Response).Message, Success = false
                };
                return(null);
            }
        }