Пример #1
0
        public async Task <BookingInfo[]> GetBookings(int Id = 0)
        {
            var bookings = new BookingInfo[0];

            try
            {
                bookings = await client.GetFromJsonAsync <BookingInfo[]>(
                    ServiceEndpoint);
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex.Message);
                System.Diagnostics.Debug.WriteLine(ex.InnerException);
            }
            if (Id > 0)
            {
                var book = from b in bookings where b.AthleteId == Id select b;
                bookings = book.ToArray <BookingInfo>();
            }
            var books2 = bookings.OrderByDescending(b => b.Date).ThenBy(b => b.Time);

            return(bookings);
        }