locked
Silverlight rest filter on more than one condition RRS feed

  • Question

  • Hi

    I want to keep track of products bought by clients (Accounts).

    I have create a bridge entity between Account and Product. (Similar to Quote and Product).

    Now I want to query a specific product belonging to a specific account.  I've got the AccountID and the ProductID.  How will I query this result?  I have tried the following:

    DataServiceQuery<new_accountproduct> queryAccountproduct = (DataServiceQuery<new_accountproduct>)
          _context.new_accountproductSet.
          AddQueryOption("$filter", "AccountId eq guid'" + AccountID + "'").
          AddQueryOption("$filter", "new_ProductLookupId eq guid'" + ParentProductID + "'");
          queryAccountproduct.BeginExecute(RetrieveAccountProductsHandler, queryAccountproduct); 

    I assume my problem lies with the AddQueryOption parts.

    Thanx

     

    Please vote if you find my post useful. Add me on Skype @ christo.skype1

    Thursday, November 1, 2012 10:42 AM

Answers