@@ -50,6 +50,7 @@ public class ParseQuery<T> where T : ParseObject {
5050 private readonly ReadOnlyCollection < string > orderBy ;
5151 private readonly ReadOnlyCollection < string > includes ;
5252 private readonly ReadOnlyCollection < string > selectedKeys ;
53+ private readonly String redirectClassNameForKey ;
5354 private readonly int ? skip ;
5455 private readonly int ? limit ;
5556
@@ -73,7 +74,8 @@ private ParseQuery(ParseQuery<T> source,
7374 int ? skip = null ,
7475 int ? limit = null ,
7576 IEnumerable < string > includes = null ,
76- IEnumerable < string > selectedKeys = null ) {
77+ IEnumerable < string > selectedKeys = null ,
78+ String redirectClassNameForKey = null ) {
7779 if ( source == null ) {
7880 throw new ArgumentNullException ( "source" ) ;
7981 }
@@ -85,6 +87,7 @@ private ParseQuery(ParseQuery<T> source,
8587 this . limit = source . limit ;
8688 this . includes = source . includes ;
8789 this . selectedKeys = source . selectedKeys ;
90+ this . redirectClassNameForKey = source . redirectClassNameForKey ;
8891
8992 if ( where != null ) {
9093 var newWhere = MergeWhereClauses ( where ) ;
@@ -127,6 +130,10 @@ private ParseQuery(ParseQuery<T> source,
127130 var newSelectedKeys = MergeSelectedKeys ( selectedKeys ) ;
128131 this . selectedKeys = new ReadOnlyCollection < string > ( newSelectedKeys . ToList ( ) ) ;
129132 }
133+
134+ if ( redirectClassNameForKey != null ) {
135+ this . redirectClassNameForKey = redirectClassNameForKey ;
136+ }
130137 }
131138
132139 private HashSet < string > MergeIncludes ( IEnumerable < string > includes ) {
@@ -326,6 +333,10 @@ public ParseQuery<T> Limit(int count) {
326333 return new ParseQuery < T > ( this , limit : count ) ;
327334 }
328335
336+ internal ParseQuery < T > RedirectClassName ( String key ) {
337+ return new ParseQuery < T > ( this , redirectClassNameForKey : key ) ;
338+ }
339+
329340 #region Where
330341
331342 /// <summary>
@@ -848,6 +859,9 @@ internal IDictionary<string, object> BuildParameters(bool includeClassName = fal
848859 if ( includeClassName ) {
849860 result [ "className" ] = className ;
850861 }
862+ if ( redirectClassNameForKey != null ) {
863+ result [ "redirectClassNameForKey" ] = redirectClassNameForKey ;
864+ }
851865 return result ;
852866 }
853867
0 commit comments