예제 #1
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));
        }
예제 #2
0
        public static PersonGetRequest GetByName(string name = "")
        {
            var personGet = new PersonGetRequest();

            if (!String.IsNullOrEmpty(name))
            {
                personGet.Name(name);
            }
            return(personGet);
        }
예제 #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));

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