Exemplo n.º 1
0
        private void GetAllPeople(object sender, RoutedEventArgs e)
        {
            _people.Clear();

            SimpleHttpClient client = new SimpleHttpClient("http://localhost:1182/people");

            IHttpQueryProvider queryProvider = new HttpQueryProvider(client);

            var query = new HttpQuery<Person>(queryProvider);
            // query.ToString() == http://localhost:1182/people

            //var query = new HttpQuery<Person>(new HttpQueryProvider(new SimpleHttpClient("http://localhost:1182")), /* resource name*/ "people");
            //// query.ToString() == http://localhost:1182/people

            //var query = new HttpQuery<Person>(queryProvider).Skip(5).Take(10);
            //// query.ToString() == http://localhost:1182/people?$skip=5$top=10

            //int id = 1;
            //var query = new HttpQuery<Person>(queryProvider).Where(c => c.ID, id);
            //// query.ToString() == http://localhost:1182/people?$filter=ID eq 1

            //var query = new HttpQuery<Person>(null, /* resource name*/ "people");
            //// query.ToString() == people

            //var query = new HttpQuery<Person>(null, /* resource name*/ "people").Take(10);
            //// query.ToString() == people?$top=10

            uxQueryText.Text = query.GetFullyQualifiedQuery(client).ToString();

            HandleQuery(query);
        }