Skip to content

Refactorings #1038

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 29 commits into from
Aug 13, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
c97d6c4
Renamed CollectionNotEmptyExpression to HasExpression
Jul 30, 2021
5e54e4e
Renamed EqualsAnyOfExpression to AnyExpression
Jul 30, 2021
b408bad
Changed SparseFieldSetExpression.Fields type from IReadOnlyCollection…
Aug 2, 2021
48f8954
Changed SparseFieldTableExpression.Table type from IReadOnlyDictionar…
Aug 2, 2021
ae4a57b
Changed SortExpression.Elements type from IReadOnlyDictionary to IImm…
Aug 2, 2021
d0f7cc1
Changed ResourceFieldChainExpression.Fields type from IReadOnlyCollec…
Aug 2, 2021
8dddf5c
Resharper quickfix: Use negated pattern
Aug 2, 2021
159b99f
Changed PaginationQueryStringValueExpression.Elements type from IRead…
Aug 3, 2021
866c8b1
Changed AnyExpression.Constants type from IReadOnlyCollection to IImm…
Aug 3, 2021
d56c7d3
Changed LogicalExpression.Terms type from IReadOnlyCollection to IImm…
Aug 3, 2021
5d164f0
Changed IncludeExpression.Elements type and IncludeElementExpression.…
Aug 3, 2021
dfee19f
Add support for `IReadOnlySet<>` usage in resource models
Aug 3, 2021
56cf588
Changed DisableQueryStringAttribute.ParameterNames type from IReadOnl…
Aug 3, 2021
1c2726b
Changed IResourceContextProvider.GetResourceContexts() to return a se…
Aug 3, 2021
1f56ae8
Updated documentation
Aug 3, 2021
031af89
Fix cibuild
Aug 3, 2021
a925aa0
Use "endpoint" in RequestMethodNotAllowedException message
Aug 4, 2021
4a955a4
Renamed StandardQueryStringParameters to JsonApiQueryStringParameters
Aug 4, 2021
07a74e8
Replaced obsolete IQueryLayerComposer.GetResourceDefinitionAccessor()…
Aug 4, 2021
680e809
Replaced obsolete IResourceFactory.GetResourceDefinitionAccessor() wi…
Aug 4, 2021
52b3773
Made TId in IResourceDefinition contravariant
Aug 4, 2021
2c222b1
Corrected terminology: relationships use left/right instead of primar…
Aug 4, 2021
a1bef68
Removed obsolete IJsonApiRequest.BasePath
Aug 4, 2021
d6b1f9d
Removed EntityFrameworkCoreSupport (no longer needed for EF Core 5+)
Aug 4, 2021
f23ab45
cibuild fixes
Aug 4, 2021
b277e1f
Always set IJsonApiRequest.OperationKind from middleware
Aug 4, 2021
0b15d45
Renamed OperationKind to WriteOperationKind, exposed as IJsonApiReque…
Aug 4, 2021
76dbf36
Automated Code cleanup
Aug 4, 2021
0c576be
Add HTTP Method to trace logging
Aug 4, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Automated Code cleanup
  • Loading branch information
Bart Koelman committed Aug 4, 2021
commit 76dbf36bc66b6c731c5cd4e3cced9509c94d3e11
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ public async Task<WorkItem> CreateAsync(WorkItem resource, CancellationToken can
return workItems.Single();
}

public Task AddToToManyRelationshipAsync(int leftId, string relationshipName, ISet<IIdentifiable> rightResourceIds,
CancellationToken cancellationToken)
public Task AddToToManyRelationshipAsync(int leftId, string relationshipName, ISet<IIdentifiable> rightResourceIds, CancellationToken cancellationToken)
{
throw new NotImplementedException();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ Task AddToToManyRelationshipAsync<TResource, TId>(TId leftId, ISet<IIdentifiable
/// <summary>
/// Invokes <see cref="IResourceWriteRepository{TResource,TId}.RemoveFromToManyRelationshipAsync" />.
/// </summary>
Task RemoveFromToManyRelationshipAsync<TResource>(TResource leftResource, ISet<IIdentifiable> rightResourceIds,
CancellationToken cancellationToken)
Task RemoveFromToManyRelationshipAsync<TResource>(TResource leftResource, ISet<IIdentifiable> rightResourceIds, CancellationToken cancellationToken)
where TResource : class, IIdentifiable;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,7 @@ public async Task SetRelationshipAsync<TResource>(TResource leftResource, object
}

/// <inheritdoc />
public async Task AddToToManyRelationshipAsync<TResource, TId>(TId leftId, ISet<IIdentifiable> rightResourceIds,
CancellationToken cancellationToken)
public async Task AddToToManyRelationshipAsync<TResource, TId>(TId leftId, ISet<IIdentifiable> rightResourceIds, CancellationToken cancellationToken)
where TResource : class, IIdentifiable<TId>
{
dynamic repository = GetWriteRepository(typeof(TResource));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ public abstract class RelationshipAttribute : ResourceFieldAttribute
public Type LeftType { get; internal set; }

/// <summary>
/// The type this relationship points to. This does not necessarily match the relationship property type. In the case of a <see cref="HasManyAttribute" /> relationship,
/// this value will be the collection element type.
/// The type this relationship points to. This does not necessarily match the relationship property type. In the case of a
/// <see cref="HasManyAttribute" /> relationship, this value will be the collection element type.
/// </summary>
/// <example>
/// <code><![CDATA[
Expand Down
3 changes: 1 addition & 2 deletions src/JsonApiDotNetCore/Services/IAddToRelationshipService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ public interface IAddToRelationshipService<TResource, in TId>
/// <param name="cancellationToken">
/// Propagates notification that request handling should be canceled.
/// </param>
Task AddToToManyRelationshipAsync(TId leftId, string relationshipName, ISet<IIdentifiable> rightResourceIds,
CancellationToken cancellationToken);
Task AddToToManyRelationshipAsync(TId leftId, string relationshipName, ISet<IIdentifiable> rightResourceIds, CancellationToken cancellationToken);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ public interface IRemoveFromRelationshipService<TResource, in TId>
/// <param name="cancellationToken">
/// Propagates notification that request handling should be canceled.
/// </param>
Task RemoveFromToManyRelationshipAsync(TId leftId, string relationshipName, ISet<IIdentifiable> rightResourceIds,
CancellationToken cancellationToken);
Task RemoveFromToManyRelationshipAsync(TId leftId, string relationshipName, ISet<IIdentifiable> rightResourceIds, CancellationToken cancellationToken);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ public Task<IActionResult> PatchAsync(string id, [FromBody] TResource resource,
}

[HttpPatch("{id}/relationships/{relationshipName}")]
public Task<IActionResult> PatchRelationshipAsync(string id, string relationshipName, [FromBody] object rightValue,
CancellationToken cancellationToken)
public Task<IActionResult> PatchRelationshipAsync(string id, string relationshipName, [FromBody] object rightValue, CancellationToken cancellationToken)
{
int idValue = _codec.Decode(id);
return base.PatchRelationshipAsync(idValue, relationshipName, rightValue, cancellationToken);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ public override async Task<TResource> UpdateAsync(TId id, TResource resource, Ca
return await base.UpdateAsync(id, resource, cancellationToken);
}

public override async Task SetRelationshipAsync(TId leftId, string relationshipName, object rightValue,
CancellationToken cancellationToken)
public override async Task SetRelationshipAsync(TId leftId, string relationshipName, object rightValue, CancellationToken cancellationToken)
{
await AssertRightResourcesExistAsync(rightValue, cancellationToken);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ public override async Task<TResource> UpdateAsync(TId id, TResource resource, Ca
return await base.UpdateAsync(id, resource, cancellationToken);
}

public override async Task SetRelationshipAsync(TId leftId, string relationshipName, object rightValue,
CancellationToken cancellationToken)
public override async Task SetRelationshipAsync(TId leftId, string relationshipName, object rightValue, CancellationToken cancellationToken)
{
if (IsSoftDeletable(_request.Relationship.RightType))
{
Expand Down