Skip to content

Commit 50bb3ec

Browse files
Manually edit files to comply with formatting rules
This commit edits files that lead to diff errors on appveyor even after having performed the ReSharper code cleanup locally (a) using the ReSharper UI, (b) the PowerShell script, and (c) the exact command line executed on appveyor. Let's hope for the best.
1 parent 19a6dd5 commit 50bb3ec

File tree

4 files changed

+23
-88
lines changed

4 files changed

+23
-88
lines changed

src/JsonApiDotNetCore/Queries/INoSqlQueryLayerComposer.cs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ public interface INoSqlQueryLayerComposer
2626
/// Composes a <see cref="QueryLayer" /> and an <see cref="IncludeExpression" /> from the constraints specified by the request. Used for primary
2727
/// resources.
2828
/// </summary>
29-
(QueryLayer QueryLayer, IncludeExpression Include) ComposeForGetByIdWithConstraintsForNoSql<TId>(
30-
TId id,
31-
ResourceType primaryResourceType,
29+
(QueryLayer QueryLayer, IncludeExpression Include) ComposeForGetByIdWithConstraintsForNoSql<TId>(TId id, ResourceType primaryResourceType,
3230
TopFieldSelection fieldSelection)
3331
where TId : notnull;
3432

@@ -58,11 +56,8 @@ QueryLayer ComposeForGetByIdForNoSql<TId>(TId id, ResourceType primaryResourceTy
5856
/// <returns>
5957
/// A tuple with a <see cref="QueryLayer" /> and an <see cref="IncludeExpression" />.
6058
/// </returns>
61-
(QueryLayer QueryLayer, IncludeExpression Include) ComposeFromConstraintsForNoSql(
62-
ResourceType requestResourceType,
63-
string propertyName,
64-
string propertyValue,
65-
bool isIncluded);
59+
(QueryLayer QueryLayer, IncludeExpression Include) ComposeFromConstraintsForNoSql(ResourceType requestResourceType, string propertyName,
60+
string propertyValue, bool isIncluded);
6661

6762
/// <summary>
6863
/// Builds a query that retrieves the primary resource, including all of its attributes and all targeted relationships, during a create/update/delete

src/JsonApiDotNetCore/Queries/NoSqlQueryLayerComposer.cs

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,8 @@ public class NoSqlQueryLayerComposer : QueryLayerComposer, INoSqlQueryLayerCompo
3838

3939
// ReSharper disable PossibleMultipleEnumeration
4040

41-
public NoSqlQueryLayerComposer(
42-
IEnumerable<IQueryConstraintProvider> constraintProviders,
43-
IResourceDefinitionAccessor resourceDefinitionAccessor,
44-
IJsonApiOptions options,
45-
IPaginationContext paginationContext,
46-
ITargetedFields targetedFields,
47-
IEvaluatedIncludeCache evaluatedIncludeCache,
41+
public NoSqlQueryLayerComposer(IEnumerable<IQueryConstraintProvider> constraintProviders, IResourceDefinitionAccessor resourceDefinitionAccessor,
42+
IJsonApiOptions options, IPaginationContext paginationContext, ITargetedFields targetedFields, IEvaluatedIncludeCache evaluatedIncludeCache,
4843
ISparseFieldSetCache sparseFieldSetCache)
4944
: base(constraintProviders, resourceDefinitionAccessor, options, paginationContext, targetedFields, evaluatedIncludeCache, sparseFieldSetCache)
5045
{
@@ -73,9 +68,7 @@ public NoSqlQueryLayerComposer(
7368
}
7469

7570
/// <inheritdoc />
76-
public (QueryLayer QueryLayer, IncludeExpression Include) ComposeForGetByIdWithConstraintsForNoSql<TId>(
77-
TId id,
78-
ResourceType primaryResourceType,
71+
public (QueryLayer QueryLayer, IncludeExpression Include) ComposeForGetByIdWithConstraintsForNoSql<TId>(TId id, ResourceType primaryResourceType,
7972
TopFieldSelection fieldSelection)
8073
where TId : notnull
8174
{
@@ -102,11 +95,8 @@ public QueryLayer ComposeForGetByIdForNoSql<TId>(TId id, ResourceType primaryRes
10295
}
10396

10497
/// <inheritdoc />
105-
public (QueryLayer QueryLayer, IncludeExpression Include) ComposeFromConstraintsForNoSql(
106-
ResourceType requestResourceType,
107-
string propertyName,
108-
string propertyValue,
109-
bool isIncluded)
98+
public (QueryLayer QueryLayer, IncludeExpression Include) ComposeFromConstraintsForNoSql(ResourceType requestResourceType, string propertyName,
99+
string propertyValue, bool isIncluded)
110100
{
111101
// Compose a secondary resource filter in the form "equals({propertyName},'{propertyValue}')".
112102
FilterExpression[] secondaryResourceFilterExpressions =

src/JsonApiDotNetCore/Resources/Annotations/NoSqlHasForeignKeyAttribute.cs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,6 @@ namespace JsonApiDotNetCore.Resources.Annotations
77
/// Used to provide additional information for a JSON:API relationship with a foreign key
88
/// (https://jsonapi.org/format/#document-resource-object-relationships).
99
/// </summary>
10-
/// <example>
11-
/// <code><![CDATA[
12-
/// public class Author : Identifiable<Guid>
13-
/// {
14-
/// [HasMany]
15-
/// [NoSqlHasForeignKey(nameof(Article.AuthorId))]
16-
/// public ICollection<Article> Articles { get; set; }
17-
/// }
18-
///
19-
/// public class Article : Identifiable<Guid>
20-
/// {
21-
/// public Guid AuthorId { get; set; }
22-
///
23-
/// [HasOne]
24-
/// [NoSqlHasForeignKey(nameof(AuthorId))]
25-
/// public Author Author { get; set; }
26-
/// }
27-
/// ]]></code>
28-
/// </example>
2910
[PublicAPI]
3011
[AttributeUsage(AttributeTargets.Property)]
3112
public class NoSqlHasForeignKeyAttribute : Attribute

src/JsonApiDotNetCore/Services/NoSqlResourceService.cs

Lines changed: 15 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -67,18 +67,10 @@ public class NoSqlResourceService<TResource, TId> : IResourceService<TResource,
6767
private readonly TraceLogWriter<NoSqlResourceService<TResource, TId>> _traceWriter;
6868
private readonly JsonApiResourceService<TResource, TId> _resourceService;
6969

70-
public NoSqlResourceService(
71-
IResourceRepositoryAccessor repositoryAccessor,
72-
IQueryLayerComposer sqlQueryLayerComposer,
73-
IPaginationContext paginationContext,
74-
IJsonApiOptions options,
75-
ILoggerFactory loggerFactory,
76-
IJsonApiRequest request,
77-
IResourceChangeTracker<TResource> resourceChangeTracker,
78-
IResourceDefinitionAccessor resourceDefinitionAccessor,
79-
INoSqlQueryLayerComposer queryLayerComposer,
80-
IResourceGraph resourceGraph,
81-
IEvaluatedIncludeCache evaluatedIncludeCache)
70+
public NoSqlResourceService(IResourceRepositoryAccessor repositoryAccessor, IQueryLayerComposer sqlQueryLayerComposer,
71+
IPaginationContext paginationContext, IJsonApiOptions options, ILoggerFactory loggerFactory, IJsonApiRequest request,
72+
IResourceChangeTracker<TResource> resourceChangeTracker, IResourceDefinitionAccessor resourceDefinitionAccessor,
73+
INoSqlQueryLayerComposer queryLayerComposer, IResourceGraph resourceGraph, IEvaluatedIncludeCache evaluatedIncludeCache)
8274
{
8375
_repositoryAccessor = repositoryAccessor;
8476
_paginationContext = paginationContext;
@@ -193,10 +185,7 @@ public async Task<TResource> GetAsync(TId id, CancellationToken cancellationToke
193185
}
194186

195187
/// <inheritdoc />
196-
public Task AddToToManyRelationshipAsync(
197-
TId primaryId,
198-
string relationshipName,
199-
ISet<IIdentifiable> secondaryResourceIds,
188+
public Task AddToToManyRelationshipAsync(TId primaryId, string relationshipName, ISet<IIdentifiable> secondaryResourceIds,
200189
CancellationToken cancellationToken)
201190
{
202191
return _resourceService.AddToToManyRelationshipAsync(primaryId, relationshipName, secondaryResourceIds, cancellationToken);
@@ -263,10 +252,7 @@ public Task DeleteAsync(TId id, CancellationToken cancellationToken)
263252
}
264253

265254
/// <inheritdoc />
266-
public async Task RemoveFromToManyRelationshipAsync(
267-
TId leftId,
268-
string relationshipName,
269-
ISet<IIdentifiable> rightResourceIds,
255+
public async Task RemoveFromToManyRelationshipAsync(TId leftId, string relationshipName, ISet<IIdentifiable> rightResourceIds,
270256
CancellationToken cancellationToken)
271257
{
272258
_traceWriter.LogMethodStart(new
@@ -329,9 +315,7 @@ protected async Task<TResource> GetPrimaryResourceByIdAsync(TId id, Cancellation
329315
/// <returns>
330316
/// The primary resource with navigation properties populated where such properties represent included resources.
331317
/// </returns>
332-
protected async Task<TResource> GetPrimaryResourceByIdWithConstraintsAsync(
333-
TId id,
334-
TopFieldSelection fieldSelection,
318+
protected async Task<TResource> GetPrimaryResourceByIdWithConstraintsAsync(TId id, TopFieldSelection fieldSelection,
335319
CancellationToken cancellationToken)
336320
{
337321
AssertPrimaryResourceTypeInJsonApiRequestIsNotNull(_request.PrimaryResourceType);
@@ -397,9 +381,7 @@ await GetIncludedElementsAsync(new[]
397381
/// <returns>
398382
/// A <see cref="Task" /> representing the asynchronous operation.
399383
/// </returns>
400-
protected virtual async Task GetIncludedElementsAsync(
401-
IReadOnlyCollection<IIdentifiable> primaryResources,
402-
IncludeExpression includeExpression,
384+
protected virtual async Task GetIncludedElementsAsync(IReadOnlyCollection<IIdentifiable> primaryResources, IncludeExpression includeExpression,
403385
CancellationToken cancellationToken)
404386
{
405387
_evaluatedIncludeCache.Set(includeExpression);
@@ -429,10 +411,8 @@ protected virtual async Task GetIncludedElementsAsync(
429411
/// <returns>
430412
/// A <see cref="Task" /> representing the asynchronous operation.
431413
/// </returns>
432-
protected virtual async Task GetIncludedElementAsync(
433-
IReadOnlyCollection<IIdentifiable> primaryResources,
434-
IncludeElementExpression includeElementExpression,
435-
CancellationToken cancellationToken)
414+
protected virtual async Task GetIncludedElementAsync(IReadOnlyCollection<IIdentifiable> primaryResources,
415+
IncludeElementExpression includeElementExpression, CancellationToken cancellationToken)
436416
{
437417
if (includeElementExpression.Children.Any())
438418
{
@@ -479,10 +459,7 @@ protected virtual async Task GetIncludedElementAsync(
479459
/// For to-many relationships, an <see cref="IReadOnlyCollection{T}" /> of <see cref="IIdentifiable" />; for to-one relationships, an
480460
/// <see cref="IIdentifiable" /> or <see langword="null" />.
481461
/// </returns>
482-
protected async Task<object?> GetSecondaryAsync(
483-
IIdentifiable primaryResource,
484-
string relationshipName,
485-
ResourceKind resourceKind,
462+
protected async Task<object?> GetSecondaryAsync(IIdentifiable primaryResource, string relationshipName, ResourceKind resourceKind,
486463
CancellationToken cancellationToken)
487464
{
488465
// Get the HasMany or HasOne attribute corresponding to the given relationship name.
@@ -576,12 +553,8 @@ protected virtual async Task GetIncludedElementAsync(
576553
/// <returns>
577554
/// The <see cref="IIdentifiable" />, if it exists, or <see langword="null" />.
578555
/// </returns>
579-
protected async Task<IIdentifiable?> GetOneSecondaryResourceAsync(
580-
ResourceType resourceType,
581-
string propertyName,
582-
string? propertyValue,
583-
ResourceKind resourceKind,
584-
CancellationToken cancellationToken)
556+
protected async Task<IIdentifiable?> GetOneSecondaryResourceAsync(ResourceType resourceType, string propertyName, string? propertyValue,
557+
ResourceKind resourceKind, CancellationToken cancellationToken)
585558
{
586559
if (propertyValue is null)
587560
{
@@ -614,12 +587,8 @@ protected virtual async Task GetIncludedElementAsync(
614587
/// <returns>
615588
/// The potentially empty collection of secondary resources.
616589
/// </returns>
617-
protected async Task<IReadOnlyCollection<IIdentifiable>> GetManySecondaryResourcesAsync(
618-
ResourceType resourceType,
619-
string propertyName,
620-
string propertyValue,
621-
ResourceKind resourceKind,
622-
CancellationToken cancellationToken)
590+
protected async Task<IReadOnlyCollection<IIdentifiable>> GetManySecondaryResourcesAsync(ResourceType resourceType, string propertyName,
591+
string propertyValue, ResourceKind resourceKind, CancellationToken cancellationToken)
623592
{
624593
bool isIncluded = resourceKind == ResourceKind.Included;
625594
var (queryLayer, include) = _queryLayerComposer.ComposeFromConstraintsForNoSql(resourceType, propertyName, propertyValue, isIncluded);

0 commit comments

Comments
 (0)