File tree Expand file tree Collapse file tree
Saleslogix.SData.Client.Test Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -366,6 +366,34 @@ public void ResultOperator_Fetch_Multiple_Test()
366366 Assert . That ( visitor . Include , Is . EqualTo ( "Address,Address/Street" ) ) ;
367367 }
368368
369+ [ Test ]
370+ public void ResultOperator_Fetch_Descriptor_Test ( )
371+ {
372+ var builder = new QueryModelBuilder ( ) ;
373+ builder . AddClause ( new MainFromClause ( "x" , typeof ( Contact ) , Expression . Constant ( null ) ) ) ;
374+ builder . AddClause ( new SelectClause ( Expression . Constant ( null ) ) ) ;
375+ builder . AddResultOperator ( new FetchResultOperator ( GetExpression ( ( Contact c ) => c . Descriptor ) ) ) ;
376+
377+ var visitor = new SDataQueryModelVisitor ( ) ;
378+ visitor . VisitQueryModel ( builder . Build ( ) ) ;
379+
380+ Assert . That ( visitor . Include , Is . EqualTo ( "$descriptors" ) ) ;
381+ }
382+
383+ [ Test ]
384+ public void ResultOperator_Fetch_Permissions_Test ( )
385+ {
386+ var builder = new QueryModelBuilder ( ) ;
387+ builder . AddClause ( new MainFromClause ( "x" , typeof ( Contact ) , Expression . Constant ( null ) ) ) ;
388+ builder . AddClause ( new SelectClause ( Expression . Constant ( null ) ) ) ;
389+ builder . AddResultOperator ( new FetchResultOperator ( GetExpression ( ( Contact c ) => c . Permissions ) ) ) ;
390+
391+ var visitor = new SDataQueryModelVisitor ( ) ;
392+ visitor . VisitQueryModel ( builder . Build ( ) ) ;
393+
394+ Assert . That ( visitor . Include , Is . EqualTo ( "$permissions" ) ) ;
395+ }
396+
369397 [ Test ]
370398 public void ResultOperator_WithPrecedence_Test ( )
371399 {
Original file line number Diff line number Diff line change @@ -7,6 +7,10 @@ public class Contact
77 {
88 [ SDataProtocolProperty ]
99 public string Key { get ; set ; }
10+ [ SDataProtocolProperty ]
11+ public string Descriptor { get ; set ; }
12+ [ SDataProtocolProperty ]
13+ public IList < SDataPermission > Permissions { get ; set ; }
1014 public ContactCivility ? Civility { get ; set ; }
1115 public string FirstName { get ; set ; }
1216 public string LastName { get ; set ; }
Original file line number Diff line number Diff line change @@ -174,9 +174,17 @@ private void CompletePath()
174174 {
175175 if ( _parts . Count > 0 )
176176 {
177- if ( ! _includeProtocolProps && _parts [ 0 ] . StartsWith ( "$" , StringComparison . Ordinal ) )
177+ if ( ! _includeProtocolProps )
178178 {
179- _parts . RemoveAt ( 0 ) ;
179+ if ( ! _selectMode && _parts . Count == 1 && _parts [ 0 ] == "$descriptor" )
180+ {
181+ _parts [ 0 ] += "s" ;
182+ }
183+ else if ( _parts [ 0 ] . StartsWith ( "$" , StringComparison . Ordinal ) &&
184+ ! ( ! _selectMode && _parts . Count == 1 && _parts [ 0 ] == "$permissions" ) )
185+ {
186+ _parts . RemoveAt ( 0 ) ;
187+ }
180188 }
181189
182190 if ( _parts . Count > 0 )
Original file line number Diff line number Diff line change 2626// by using the '*' as shown below:
2727
2828[ assembly: AssemblyVersion ( "2.0" ) ]
29- [ assembly: AssemblyFileVersion ( "2.0.1.1561 " ) ]
29+ [ assembly: AssemblyFileVersion ( "2.0.1.1562 " ) ]
3030[ assembly: NeutralResourcesLanguage ( "en-US" ) ]
3131[ assembly: AssemblyInformationalVersion ( "2.0" ) ]
3232[ assembly: InternalsVisibleTo ( "Saleslogix.SData.Client.Test, PublicKey=" +
You can’t perform that action at this time.
0 commit comments