Skip to content

Refactorings for v4 #893

Closed
Closed
@bart-degreed

Description

@bart-degreed

DESCRIPTION

List of small refactorings and code improvements:

  • The classes JsonApiController<TResource> and JsonApiController<TResource, TId> should be made abstract (and their constructors protected)
  • Optimization in catch block of JsonApiResourceService.CreateAsync: only check for existing resource if an ID was specified in the request body: if (!Equals(resourceFromRequest.Id, default(TId))) { ... }
  • Rename JsonApiDotNetCoreExampleTests.IntegrationTests.ReadWrite.WriteFakers.WorkTags and ..._lazyWorkTagsFaker to singular, like the rest in there
  • Add missing properties to serialization models, such as document.jsonapi and links.describedby
  • Change IResourceGraph dependency in JsonApiRoutingConvention to IResourceContextProvider
  • Remove the code path for if (_serializer == null) in JsonApiWriter.WriteAsync, because its constructor asserts that _serializer can never be null
  • Class TestServerExtensions has no usages and can be removed
  • Rename EntityFrameworkCoreRepository.IsRequiredToManyRelationshipBeingCleared to IsToManyRelationshipBeingCleared
  • Rename IQueryLayerComposer.ComposeForHasManyThrough to ComposeForHasMany and change first parameter to HasManyAttribute hasManyRelationship (also update doc-comment to reflect this)
  • Search/replace remaining usages of Context.RemoveRange( with ClearTableAsync in tests
  • Rename IControllerResourceMapping.GetAssociatedResource to GetResourceTypeForController
  • Remove IRequestQueryStringAccessor.QueryString (no usages)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions