public void Test_POCO_Projection() { var config = new ClientConfiguration(); var client = new QueryClient(new HttpClient(), new JsonDataMapper(config), config); var uri = new Uri("http://localhost:8093/query"); const string bucket = "tutorial"; var query = from c in client.Queryable<Contact>(bucket, uri) select c; foreach (var contact in query) { Console.WriteLine(contact.FirstName); } }
public void Test_Select_Children() { var config = new ClientConfiguration(); var client = new QueryClient(new HttpClient(), new JsonDataMapper(config), config); var uri = new Uri("http://localhost:8093/query"); const string bucket = "tutorial"; var query = from c in client.Queryable<Contact>(bucket, uri) select c.Children; foreach (var child in query) { Console.WriteLine("{0}, {1}", child, child); } }
public void Test_AnonymousType_Projection() { var config = new ClientConfiguration(); var client = new QueryClient(new HttpClient(), new JsonDataMapper(config), config); var uri = new Uri("http://localhost:8093/query"); const string bucket = "tutorial"; var query = from c in client.Queryable<Contact>(bucket, uri) select new { age = c.Age, fname = c.FirstName }; foreach (var contact in query) { Console.WriteLine("{0}, {1}", contact.fname, contact.age); } }