Friday 15 June 2012

c# - Iterating through Collection to build a Where statement for Azure Table Query on Windows Phone 8 -


I need to create a query to get the list of objects (they cat Call.) To get this list of items on Windows Phone 8 from the database stored on Microsoft Azure (< Strong> cats ) I have to walk again through the list of other items to remove foreign objects; Ask a list of CatHomes . But I also want all cats called Bob .

I know that all cats are called bob :

  private async zero getCatsForCatHomesOrCalledBob (collection & Lt; CatHome & gt; homes) {// Get a list of cats who visit cats homes in the collection, IMobileServiceTableQuery & lt; Cat & gt; Query = catTable Where (cat = & gt; cat.Name == "Bob"); Collections & lt; Cat & gt; Item = null; // Add items to a list item = wait for query. Taxation sink (); }   

But how can I also iterate through the CatHome object's archive and add it to the query to add it Can i

I know that I can do something like this:

  IMobileServiceTableQuery & lt; Cat & gt; Query = catTable.Where (cat = & gt; cat.Name == "Bob"} cat.HomeId == 1 || cat.HomeId == 2);   

which does not allow me to redo through archive , what do I do:

  IMobileServiceTableQuery & Lt; Cat & gt; Query = catTable.Where (cat = & gt; cat.Name == "Bob"); Foreign (home cathome home) {query.AddOrStatement (cat.HomeId == home.Id); }   

But there can be no way to do this.

Is there any alternative? Ideally I would like to be able to pass the string variable to where () , like I can make the SQL statement as the string , But there can be no means to do this.

Android and iOS have functionality similar to where you . Or () or . And () methods, which are not present in WP8 in IMobileServiceTableQuery , and things like Skip () , which is currently in .

I know that I can repeat through the list of CatHome objects and do a query for each one, by adding results to a master list, but this phone Sounds like poor use of resources.

Any help would be appreciated.

No comments:

Post a Comment