11// Copyright (c) Microsoft Corporation. All rights reserved.
22// Licensed under the MIT License. See License.txt in the project root for license information.
33
4- using Community . OData . Linq . Common ;
5- using Community . OData . Linq . OData . Formatter ;
6- using Community . OData . Linq . Properties ;
7- using Microsoft . OData ;
8- using Microsoft . OData . Edm ;
9- using Microsoft . OData . UriParser ;
10-
11- namespace System . Web . OData . Query . Validators
4+ namespace Community . OData . Linq . Builder . Validators
125{
6+ using Community . OData . Linq . Common ;
7+ using Community . OData . Linq . OData . Formatter ;
8+ using Community . OData . Linq . Properties ;
9+
10+ using Microsoft . OData ;
11+ using Microsoft . OData . Edm ;
12+ using Microsoft . OData . UriParser ;
13+
1314 internal class OrderByModelLimitationsValidator : QueryNodeVisitor < SingleValueNode >
1415 {
1516 private readonly IEdmModel _model ;
@@ -19,16 +20,16 @@ internal class OrderByModelLimitationsValidator : QueryNodeVisitor<SingleValueNo
1920
2021 public OrderByModelLimitationsValidator ( IEdmModel model , bool enableOrderBy )
2122 {
22- _model = model ;
23- _enableOrderBy = enableOrderBy ;
23+ this . _model = model ;
24+ this . _enableOrderBy = enableOrderBy ;
2425 }
2526
2627 public bool TryValidate ( IEdmProperty property , IEdmStructuredType structuredType , OrderByClause orderByClause ,
2728 bool explicitPropertiesDefined )
2829 {
29- _property = property ;
30- _structuredType = structuredType ;
31- return TryValidate ( orderByClause , explicitPropertiesDefined ) ;
30+ this . _property = property ;
31+ this . _structuredType = structuredType ;
32+ return this . TryValidate ( orderByClause , explicitPropertiesDefined ) ;
3233 }
3334
3435 // Visits the expression to find the first node if any, that is not sortable and throws
@@ -53,7 +54,7 @@ public override SingleValueNode Visit(SingleValuePropertyAccessNode nodeIn)
5354 {
5455 SingleNavigationNode singleNavigationNode = nodeIn . Source as SingleNavigationNode ;
5556 if ( EdmLibHelpers . IsNotSortable ( nodeIn . Property , singleNavigationNode . NavigationProperty ,
56- singleNavigationNode . NavigationProperty . ToEntityType ( ) , _model , _enableOrderBy ) )
57+ singleNavigationNode . NavigationProperty . ToEntityType ( ) , this . _model , this . _enableOrderBy ) )
5758 {
5859 return nodeIn ;
5960 }
@@ -62,12 +63,12 @@ public override SingleValueNode Visit(SingleValuePropertyAccessNode nodeIn)
6263 {
6364 SingleComplexNode singleComplexNode = nodeIn . Source as SingleComplexNode ;
6465 if ( EdmLibHelpers . IsNotSortable ( nodeIn . Property , singleComplexNode . Property ,
65- nodeIn . Property . DeclaringType , _model , _enableOrderBy ) )
66+ nodeIn . Property . DeclaringType , this . _model , this . _enableOrderBy ) )
6667 {
6768 return nodeIn ;
6869 }
6970 }
70- else if ( EdmLibHelpers . IsNotSortable ( nodeIn . Property , _property , _structuredType , _model , _enableOrderBy ) )
71+ else if ( EdmLibHelpers . IsNotSortable ( nodeIn . Property , this . _property , this . _structuredType , this . _model , this . _enableOrderBy ) )
7172 {
7273 return nodeIn ;
7374 }
@@ -83,7 +84,7 @@ public override SingleValueNode Visit(SingleValuePropertyAccessNode nodeIn)
8384
8485 public override SingleValueNode Visit ( SingleComplexNode nodeIn )
8586 {
86- if ( EdmLibHelpers . IsNotSortable ( nodeIn . Property , _property , _structuredType , _model , _enableOrderBy ) )
87+ if ( EdmLibHelpers . IsNotSortable ( nodeIn . Property , this . _property , this . _structuredType , this . _model , this . _enableOrderBy ) )
8788 {
8889 return nodeIn ;
8990 }
@@ -98,8 +99,8 @@ public override SingleValueNode Visit(SingleComplexNode nodeIn)
9899
99100 public override SingleValueNode Visit ( SingleNavigationNode nodeIn )
100101 {
101- if ( EdmLibHelpers . IsNotSortable ( nodeIn . NavigationProperty , _property , _structuredType , _model ,
102- _enableOrderBy ) )
102+ if ( EdmLibHelpers . IsNotSortable ( nodeIn . NavigationProperty , this . _property , this . _structuredType , this . _model ,
103+ this . _enableOrderBy ) )
103104 {
104105 return nodeIn ;
105106 }
0 commit comments