@@ -29,7 +29,7 @@ public QueryParser(
29
29
_options = options ;
30
30
}
31
31
32
- public QuerySet Parse ( IQueryCollection query )
32
+ public virtual QuerySet Parse ( IQueryCollection query )
33
33
{
34
34
var querySet = new QuerySet ( ) ;
35
35
var disabledQueries = _controllerContext . GetControllerAttribute < DisableQueryAttribute > ( ) ? . QueryParams ?? QueryParams . None ;
@@ -78,7 +78,7 @@ public QuerySet Parse(IQueryCollection query)
78
78
return querySet ;
79
79
}
80
80
81
- private List < FilterQuery > ParseFilterQuery ( string key , string value )
81
+ protected virtual List < FilterQuery > ParseFilterQuery ( string key , string value )
82
82
{
83
83
// expected input = filter[id]=1
84
84
// expected input = filter[id]=eq:1
@@ -96,7 +96,7 @@ private List<FilterQuery> ParseFilterQuery(string key, string value)
96
96
return queries ;
97
97
}
98
98
99
- private ( string operation , string value ) ParseFilterOperation ( string value )
99
+ protected virtual ( string operation , string value ) ParseFilterOperation ( string value )
100
100
{
101
101
if ( value . Length < 3 )
102
102
return ( string . Empty , value ) ;
@@ -116,7 +116,7 @@ private List<FilterQuery> ParseFilterQuery(string key, string value)
116
116
return ( prefix , value ) ;
117
117
}
118
118
119
- private PageQuery ParsePageQuery ( PageQuery pageQuery , string key , string value )
119
+ protected virtual PageQuery ParsePageQuery ( PageQuery pageQuery , string key , string value )
120
120
{
121
121
// expected input = page[size]=10
122
122
// page[number]=1
@@ -134,7 +134,7 @@ private PageQuery ParsePageQuery(PageQuery pageQuery, string key, string value)
134
134
135
135
// sort=id,name
136
136
// sort=-id
137
- private List < SortQuery > ParseSortParameters ( string value )
137
+ protected virtual List < SortQuery > ParseSortParameters ( string value )
138
138
{
139
139
var sortParameters = new List < SortQuery > ( ) ;
140
140
value . Split ( ',' ) . ToList ( ) . ForEach ( p =>
@@ -154,7 +154,7 @@ private List<SortQuery> ParseSortParameters(string value)
154
154
return sortParameters ;
155
155
}
156
156
157
- private List < string > ParseIncludedRelationships ( string value )
157
+ protected virtual List < string > ParseIncludedRelationships ( string value )
158
158
{
159
159
if ( value . Contains ( "." ) )
160
160
throw new JsonApiException ( 400 , "Deeply nested relationships are not supported" ) ;
@@ -164,7 +164,7 @@ private List<string> ParseIncludedRelationships(string value)
164
164
. ToList ( ) ;
165
165
}
166
166
167
- private List < string > ParseFieldsQuery ( string key , string value )
167
+ protected virtual List < string > ParseFieldsQuery ( string key , string value )
168
168
{
169
169
// expected: fields[TYPE]=prop1,prop2
170
170
var typeName = key . Split ( '[' , ']' ) [ 1 ] ;
@@ -187,7 +187,7 @@ private List<string> ParseFieldsQuery(string key, string value)
187
187
return includedFields ;
188
188
}
189
189
190
- private AttrAttribute GetAttribute ( string propertyName )
190
+ protected virtual AttrAttribute GetAttribute ( string propertyName )
191
191
=> _controllerContext
192
192
. RequestEntity
193
193
. Attributes
0 commit comments