Esempio n. 1
0
        //Prog de test
        public string Lance()
        {
            //Déclare une nouvelle requete
            ReqAPI ReqContact = new ReqAPI();

            try
            {
                //Ouvre la connexion
                Task.WaitAll(Task.Run(async() => await RunAsync(ReqContact)));
            }
            catch (System.Exception ex) { Err.DisplayException(ex); }
            finally
            {
                if (Co.GetHTTPClient() != null)
                {
                    Co.Déconnecte();
                }
            }

            Console.WriteLine(Contacts.GetPerson[0].m_firstname);
            Console.WriteLine(Contacts.GetPerson[1].m_firstname);
            Console.WriteLine(Contacts.GetPerson[2].m_firstname);
            Console.ReadKey();

            return(Contacts.GetPerson[0].m_firstname);
        }
Esempio n. 2
0
 //Appel methodes Asynk pour récup la version
 public async Task RunAsyncApiVersion(DisplayErr Err)
 {
     try
     {
         await ReqApiVersion(GetHTTPClient());
     }
     catch (Exception ex)
     {
         Err.DisplayException(ex);
     }
 }
Esempio n. 3
0
        //Test SSIS
        public string Lance()
        {
            //Déclare une nouvelle requete
            ReqAPI ReqContact = new ReqAPI();

            try
            {
                //Ouvre la connexion
                httpClient = Co.GetHTTPClient();
                Task.WaitAll(Task.Run(async() => await RunAsync(ReqContact)));
            }
            catch (System.Exception ex) { Err.DisplayException(ex); }
            finally
            {
                if (httpClient != null)
                {
                    httpClient.Dispose();
                }
            }
            return(Contacts.GetPerson[0].m_firstname);
        }