Ejemplo n.º 1
0
        static async Task GetAll(TripClient tripClient)
        {
            Console.WriteLine("Get all");
            List <Trip> trips = await tripClient.GetAll();

            trips.ForEach(Console.WriteLine);
        }
Ejemplo n.º 2
0
        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);
            }
        }
Ejemplo n.º 3
0
        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);
            }
        }