Collection Exists Criteria in WCF Data Services

后端 未结 3 1074
自闭症患者
自闭症患者 2020-12-18 05:57

I\'m trying to ask my OData service:

\"Give me all the Products that do not have a Category\"

with the Products and Category have a m2m relationship.

<
3条回答
  •  执笔经年
    2020-12-18 06:21

    My solution to this problem was to $expand the related field in the query, and then test if that field was empty or not...

       JArray _array = (JArray)main_table_object["some_related_field"];
    
       if (_array.Count > 0) 
          continue; 
    

    .. this is in the context of queries from Windows 7 phone to a WCF service using JSON as the message format.

提交回复
热议问题