Esempio n. 1
0
        public static PersonGetRequest GetByName(string name = "")
        {
            var personGet = new PersonGetRequest();

            if (!String.IsNullOrEmpty(name))
            {
                personGet.Name(name);
            }
            return(personGet);
        }
Esempio n. 2
0
        public static async Task Using_Custom_Requests()
        {
            PersonGetRequest personGetRequest = new PersonGetRequest();

            RestResponse <Person> persGetResponse = await personGetRequest.Name("testUser").GetPerson();

            if (persGetResponse.HasData)
            {
                Person person = persGetResponse.Data;
                //...
            }

            // or with actions
            await personGetRequest.Name("testUser").GetPerson(
                (r) => Debug.WriteLine(r.Data.Name + " is " + r.Data.Age + " years old."),
                (r) => Debug.WriteLine(r.Exception.Message));
        }
Esempio n. 3
0
        public static async Task Using_Custom_Requests()
        {
            PersonGetRequest personGetRequest = new PersonGetRequest();

            RestResponse<Person> persGetResponse = await personGetRequest.Name("testUser").GetPerson();

            if (persGetResponse.HasData)
            {
                Person person = persGetResponse.Data;
                //...
            }

            // or with actions
            await personGetRequest.Name("testUser").GetPerson(
                (r) => Debug.WriteLine(r.Data.Name + " is " + r.Data.Age + " years old."),
                (r) => Debug.WriteLine(r.Exception.Message));

        }
Esempio n. 4
0
 public static PersonGetRequest GetByName(string name = "")
 {
     var personGet = new PersonGetRequest();
     if (!String.IsNullOrEmpty(name))
         personGet.Name(name);
     return personGet;
 }