static async Task GetAll(TripClient tripClient) { Console.WriteLine("Get all"); List <Trip> trips = await tripClient.GetAll(); trips.ForEach(Console.WriteLine); }
private static async Task Delete(TripClient tripClient) { try { Console.WriteLine("Delete"); List <Trip> trips = await tripClient.GetAll(); Trip trip = trips[trips.Count - 1]; Trip result = await tripClient.Delete(trip.Id); Console.WriteLine(result); await GetAll(tripClient); } catch (ServiceException se) { Console.WriteLine(se.Message); } }
private static async Task Update(TripClient tripClient) { try { Console.WriteLine("Update"); List <Trip> trips = await tripClient.GetAll(); Trip trip = trips[trips.Count - 1]; trip.Landmark = "updatedLandmark"; Trip result = await tripClient.Update(trip); Console.WriteLine(result); await GetAll(tripClient); } catch (ServiceException se) { Console.WriteLine(se.Message); } }