Skip to content

Commit d1af7cc

Browse files
committed
chore: various minor fixes, PR self review
1 parent f78a188 commit d1af7cc

File tree

22 files changed

+76
-44
lines changed

22 files changed

+76
-44
lines changed

src/Examples/JsonApiDotNetCoreExample/Controllers/Restricted/ReadOnlyController.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
namespace JsonApiDotNetCoreExample.Controllers.Restricted
55
{
6-
76
[Route("[controller]")]
87
[HttpReadOnly]
98
public class ReadOnlyController : ControllerBase

src/Examples/JsonApiDotNetCoreExample/Services/CustomArticleService.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,19 @@ namespace JsonApiDotNetCoreExample.Services
1616
{
1717
public class CustomArticleService : EntityResourceService<Article>
1818
{
19-
public CustomArticleService(ISortService sortService, IFilterService filterService, IEntityRepository<Article, int> repository, IJsonApiOptions options, ICurrentRequest currentRequest, IIncludeService includeService, ISparseFieldsService sparseFieldsService, IPageService pageManager, IResourceGraph resourceGraph, IResourceHookExecutor hookExecutor = null, ILoggerFactory loggerFactory = null) : base(sortService, filterService, repository, options, currentRequest, includeService, sparseFieldsService, pageManager, resourceGraph, hookExecutor, loggerFactory)
19+
public CustomArticleService(ISortService sortService,
20+
IFilterService filterService,
21+
IEntityRepository<Article, int> repository,
22+
IJsonApiOptions options,
23+
ICurrentRequest currentRequest,
24+
IIncludeService includeService,
25+
ISparseFieldsService sparseFieldsService,
26+
IPageService pageManager,
27+
IResourceGraph resourceGraph,
28+
IResourceHookExecutor hookExecutor = null,
29+
ILoggerFactory loggerFactory = null)
30+
: base(sortService, filterService, repository, options, currentRequest, includeService, sparseFieldsService,
31+
pageManager, resourceGraph, hookExecutor, loggerFactory)
2032
{
2133
}
2234

src/Examples/NoEntityFrameworkExample/Properties/launchSettings.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@
88
}
99
},
1010
"profiles": {
11-
"IIS Express": {
12-
"commandName": "IISExpress",
13-
"launchBrowser": true,
14-
"environmentVariables": {
15-
"ASPNETCORE_ENVIRONMENT": "Development"
16-
}
17-
},
1811
"NoEntityFrameworkExample": {
1912
"commandName": "Project",
2013
"launchBrowser": true,
2114
"environmentVariables": {
2215
"ASPNETCORE_ENVIRONMENT": "Development"
2316
},
2417
"applicationUrl": "http://localhost:5000/"
18+
},
19+
"IIS Express": {
20+
"commandName": "IISExpress",
21+
"launchBrowser": true,
22+
"environmentVariables": {
23+
"ASPNETCORE_ENVIRONMENT": "Development"
24+
}
2525
}
2626
}
2727
}

src/JsonApiDotNetCore/Controllers/DisableQueryAttribute.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,22 @@
33
namespace JsonApiDotNetCore.Controllers
44
{
55
public class DisableQueryAttribute : Attribute
6-
{
6+
{
7+
/// <summary>
8+
/// Disabled one of the native query parameters for a controller.
9+
/// </summary>
10+
/// <param name="queryParams"></param>
711
public DisableQueryAttribute(QueryParams queryParams)
812
{
913
QueryParams = queryParams.ToString("G").ToLower();
1014
}
1115

16+
/// <summary>
17+
/// It is allowed to use strings to indicate which query parameters
18+
/// should be disabled, because the user may have defined a custom
19+
/// query parameter that is not included in the <see cref="QueryParams"/> enum.
20+
/// </summary>
21+
/// <param name="customQueryParams"></param>
1222
public DisableQueryAttribute(string customQueryParams)
1323
{
1424
QueryParams = customQueryParams.ToLower();
Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
11
namespace JsonApiDotNetCore.Internal.Query
22
{
33
public static class QueryConstants {
4-
public const string FILTER = "filter";
5-
public const string SORT = "sort";
6-
public const string INCLUDE = "include";
7-
public const string PAGE = "page";
8-
public const string FIELDS = "fields";
94
public const char OPEN_BRACKET = '[';
105
public const char CLOSE_BRACKET = ']';
116
public const char COMMA = ',';
127
public const char COLON = ':';
138
public const string COLON_STR = ":";
149
public const char DOT = '.';
15-
1610
}
1711
}

src/JsonApiDotNetCore/JsonApiDotNetCore.csproj

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,4 @@
4444
<ItemGroup Condition="'$(GenerateDocumentation)' == 'true'">
4545
<PackageReference Include="docfx.console" Version="2.33.0" />
4646
</ItemGroup>
47-
<ItemGroup>
48-
<Folder Include="Models\JsonApiDocuments\" />
49-
<Folder Include="QueryParameterServices\" />
50-
<Folder Include="Internal\Exceptions\" />
51-
<Folder Include="Models\Annotation\" />
52-
<Folder Include="Serialization\Common\" />
53-
<Folder Include="Serialization\Client\" />
54-
<Folder Include="Serialization\Server\" />
55-
<Folder Include="Serialization\Server\Builders\" />
56-
<Folder Include="QueryParameterServices\Contracts\" />
57-
<Folder Include="QueryParameterServices\Common\" />
58-
<Folder Include="Serialization\Server\Contracts\" />
59-
</ItemGroup>
6047
</Project>

src/JsonApiDotNetCore/QueryParameterServices/Common/IQueryParameterParser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace JsonApiDotNetCore.Services
77
/// Responsible for populating the various service implementations of
88
/// <see cref="IQueryParameterService"/>.
99
/// </summary>
10-
public interface IQueryParameterParser
10+
public interface IQueryParameterDiscovery
1111
{
1212
void Parse(IQueryCollection query, DisableQueryAttribute disabledQuery = null);
1313
}

src/JsonApiDotNetCore/QueryParameterServices/Common/IQueryParameterService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public interface IQueryParameterService
1111
/// <summary>
1212
/// Parses the value of the query parameter. Invoked in the middleware.
1313
/// </summary>
14-
/// <param name="queryParameter">the value of the query parameter as parsed from the url</param>
14+
/// <param name="queryParameter">the value of the query parameter as retrieved from the url</param>
1515
void Parse(KeyValuePair<string, StringValues> queryParameter);
1616
/// <summary>
1717
/// The name of the query parameter as matched in the URL query string.

src/JsonApiDotNetCore/QueryParameterServices/Common/QueryParameterService.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ protected AttrAttribute GetAttribute(string target, RelationshipAttribute relati
6464
return attribute;
6565
}
6666

67-
6867
/// <summary>
6968
/// Helper method for parsing query parameters into relationships attributes
7069
/// </summary>

src/JsonApiDotNetCore/QueryParameterServices/Contracts/IFilterService.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,14 @@
33

44
namespace JsonApiDotNetCore.Query
55
{
6+
/// <summary>
7+
/// Query parameter service responsible for url queries of the form ?filter[X]=Y
8+
/// </summary>
69
public interface IFilterService : IQueryParameterService
710
{
11+
/// <summary>
12+
/// Gets the parsed filter queries
13+
/// </summary>
814
List<FilterQueryContext> Get();
915
}
1016
}

0 commit comments

Comments
 (0)