Esempio n. 1
0
 /// <summary>
 /// Adds a constraint to the query that requires that a particular key's value
 /// matches another ParseQuery. This only works on keys whose values are
 /// ParseObjects or lists of ParseObjects.
 /// </summary>
 /// <param name="key">The key to check.</param>
 /// <param name="query">The query that the value should match.</param>
 /// <returns>A new query with the additional constraint.</returns>
 public ParseQuery <T> WhereMatchesQuery <TOther>(string key, ParseQuery <TOther> query)
     where TOther : ParseObject
 {
     return(new ParseQuery <T>(this, @where: new Dictionary <string, object>
     {
         { key, new Dictionary <string, object> {
               { "$inQuery", query.BuildParameters(true) }
           } }
     }));
 }
Esempio n. 2
0
        /// <summary>
        /// Adds a constraint to the query that requires a particular key's value
        /// does not match any value for a key in the results of another ParseQuery.
        /// </summary>
        /// <param name="key">The key whose value is being checked.</param>
        /// <param name="keyInQuery">The key in the objects from the subquery to look in.</param>
        /// <param name="query">The subquery to run</param>
        /// <returns>A new query with the additional constraint.</returns>
        public ParseQuery <T> WhereDoesNotMatchesKeyInQuery <TOther>(string key,
                                                                     string keyInQuery,
                                                                     ParseQuery <TOther> query) where TOther : ParseObject
        {
            var parameters = new Dictionary <string, object>
            {
                { "query", query.BuildParameters(true) },
                { "key", keyInQuery }
            };

            return(new ParseQuery <T>(this, @where: new Dictionary <string, object>
            {
                { key, new Dictionary <string, object> {
                      { "$dontSelect", parameters }
                  } }
            }));
        }