Пример #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());
 }