@@ -1212,9 +1212,43 @@ public Query Only(String[] fieldUid)
12121212 Console . WriteLine ( "IOException source: {0}" , e . Source ) ;
12131213 }
12141214
1215+ return this ;
1216+ }
1217+
1218+ /// <summary>
1219+ /// Specifies an array of only keys that would be included in the response.
1220+ /// </summary>
1221+ /// <param name="keys">Array of the only reference keys to be included in response.</param>
1222+ /// <param name="referenceKey">Key who has reference to some other class object.</param>
1223+ /// <returns>Current instance of Entry, this will be useful for a chaining calls.</returns>
1224+ /// <example>
1225+ /// <code>
1226+ /// ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
1227+ /// Query csQuery = stack.ContentType("contentType_id").Query();
1228+ ///
1229+ /// csQuery.IncludeOnlyReference(new String[]{"name", "description"}, "referenceUid");
1230+ /// csQuery.Find<Product>().ContinueWith((queryResult) => {
1231+ /// //Your callback code.
1232+ /// });
1233+ /// </code>
1234+ /// </example>
1235+ public Query IncludeOnlyReference ( string [ ] keys , string referenceKey )
1236+ {
1237+ if ( keys != null && keys . Length > 0 )
1238+ {
1239+ var referenceKeys = new string [ ] { referenceKey } ;
1240+ if ( UrlQueries . ContainsKey ( "include[]" ) == false )
1241+ {
1242+ UrlQueries . Add ( "include[]" , referenceKeys ) ;
1243+
1244+ }
1245+ if ( UrlQueries . ContainsKey ( $ "only[{ referenceKey } ][]") == false )
1246+ {
1247+ UrlQueries . Add ( $ "only[{ referenceKey } ][]", keys ) ;
1248+ }
1249+ }
12151250 return this ;
12161251 }
1217-
12181252 /// <summary>
12191253 /// Specifies list of field uids that would be excluded from the response.
12201254 /// </summary>
@@ -1249,6 +1283,40 @@ public Query Except(String[] fieldUids)
12491283 return this ;
12501284 }
12511285
1286+ /// <summary>
1287+ /// Specifies an array of except keys that would be excluded in the response.
1288+ /// </summary>
1289+ /// <param name="keys">Array of the except reference keys to be excluded in response.</param>
1290+ /// <param name="referenceKey">Key who has reference to some other class object.</param>
1291+ /// <returns>Current instance of Entry, this will be useful for a chaining calls.</returns>
1292+ /// <example>
1293+ /// <code>
1294+ /// ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
1295+ /// Query csQuery = stack.ContentType("contentType_id").Query();
1296+ /// csQuery.IncludeExceptReference(new String[]{"name", "description"},"referenceUid");
1297+ /// csQuery.Find<Product>().ContinueWith((queryResult) => {
1298+ /// //Your callback code.
1299+ /// });
1300+ /// </code>
1301+ /// </example>
1302+ public Query IncludeExceptReference ( string [ ] keys , string referenceKey )
1303+ {
1304+ if ( keys != null && keys . Length > 0 )
1305+ {
1306+ var referenceKeys = new string [ ] { referenceKey } ;
1307+ if ( UrlQueries . ContainsKey ( "include[]" ) == false )
1308+ {
1309+ UrlQueries . Add ( "include[]" , referenceKeys ) ;
1310+
1311+ }
1312+ if ( UrlQueries . ContainsKey ( $ "except[{ referenceKey } ][]") == false )
1313+ {
1314+ UrlQueries . Add ( $ "except[{ referenceKey } ][]", keys ) ;
1315+ }
1316+ }
1317+ return this ;
1318+ }
1319+
12521320 /// <summary>
12531321 /// Include fallback locale publish content, if specified locale content is not publish.
12541322 /// </summary>
0 commit comments