コード例 #1
0
ファイル: AVQuery.cs プロジェクト: aisk/LeanCloud-SDK-dotNET
 /// <summary>
 /// Adds a constraint to the query that requires that a particular key's value
 /// matches another AVQuery. This only works on keys whose values are
 /// AVObjects or lists of AVObjects.
 /// </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 AVQuery <T> WhereMatchesQuery <TOther>(string key, AVQuery <TOther> query)
     where TOther : AVObject
 {
     return(new AVQuery <T>(this, where : new Dictionary <string, object> {
         { key, new Dictionary <string, object> {
               { "$inQuery", query.BuildParameters(true) }
           } }
     }));
 }
コード例 #2
0
ファイル: IAVQuery.cs プロジェクト: longyunzhou/NFC
 /// <summary>
 /// Adds a constraint to the query that requires that a particular key's value
 /// matches another AVQuery. This only works on keys whose values are
 /// AVObjects or lists of AVObjects.
 /// </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 virtual S WhereMatchesQuery <TOther>(string key, AVQuery <TOther> query)
     where TOther : AVObject
 {
     return(CreateInstance(this, where : new Dictionary <string, object> {
         { key, new Dictionary <string, object> {
               { "$inQuery", query.BuildParameters(true) }
           } }
     }));
 }
コード例 #3
0
ファイル: AVQuery.cs プロジェクト: aisk/LeanCloud-SDK-dotNET
        /// <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 AVQuery.
        /// </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 AVQuery <T> WhereDoesNotMatchesKeyInQuery <TOther>(string key,
                                                                  string keyInQuery,
                                                                  AVQuery <TOther> query) where TOther : AVObject
        {
            var parameters = new Dictionary <string, object> {
                { "query", query.BuildParameters(true) },
                { "key", keyInQuery }
            };

            return(new AVQuery <T>(this, where : new Dictionary <string, object> {
                { key, new Dictionary <string, object> {
                      { "$dontSelect", parameters }
                  } }
            }));
        }
コード例 #4
0
ファイル: IAVQuery.cs プロジェクト: longyunzhou/NFC
        /// <summary>
        /// Adds a constraint to the query that requires a particular key's value
        /// to match a value for a key in the results of another AVQuery.
        /// </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 virtual S WhereMatchesKeyInQuery <TOther>(string key,
                                                         string keyInQuery,
                                                         AVQuery <TOther> query) where TOther : AVObject
        {
            var parameters = new Dictionary <string, object> {
                { "query", query.BuildParameters(true) },
                { "key", keyInQuery }
            };

            return(CreateInstance(this, where : new Dictionary <string, object> {
                { key, new Dictionary <string, object> {
                      { "$select", parameters }
                  } }
            }));
        }