示例#1
0
 static async Task MainAsync()
 {
     var client = new PersonClient();
     await Fetch(client);
     var person = await Create(client);
     await Update(client, person.Id, new PersonUpdateOptions { First = "Betty" });
 }
示例#2
0
 private static async Task Fetch(PersonClient client)
 {
     Console.WriteLine("Fetch");
     var persons = await client.FetchAsync();
     foreach (var person in persons)
     {
         Console.WriteLine(person.ToString());
     }
 }
示例#3
0
 private static async Task<Person> Create(PersonClient client)
 {
     Console.WriteLine("Create");
     var person = await client.CreateAsync(new PersonAddOptions
     {
         First = "Barney",
         Last = "Ruble"
     });
     Console.WriteLine(person.ToString());
     return person;
 }
示例#4
0
 private static async Task Update(PersonClient client, long id, PersonUpdateOptions options)
 {
     Console.WriteLine("Update");
     var person = await client.UpdateAsync(id, options);
     Console.WriteLine(person.ToString());
 }