Skip to content

Relationship endpoint bugfixes, implement POST and DELETE on to-many relationship link #851

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

Closed
wants to merge 274 commits into from

Conversation

maurei
Copy link
Member

@maurei maurei commented Oct 4, 2020

This PR concerns work-in-progress on write operations and is continued at #874.

@maurei maurei changed the title Implement POST and DELETE on to-many relationship link Relationship endpoint bugfixes, implement POST and DELETE on to-many relationship link Oct 6, 2020
@maurei maurei marked this pull request as ready for review October 8, 2020 13:47
Copy link
Contributor

@bart-degreed bart-degreed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Holding off further review until cleanup work has been done.

Bart Koelman and others added 24 commits November 3, 2020 14:31
… entities in repositories using static query building

fix: Detach -> DetachEntities and related refactor
feat: GetResourcesByIds service to remove code duplication of former GetResourcesStringIdsAsync method
chore: update error message and renamed to SecondaryResourcesNotFoundException
fix: use ISet instead of IList in targeted fields
refactor: simplified ResourceRepositoryAccessor by using dynamic invocation instead of reflective
…reign_key' in every test name because this is already in the test suite
…Repository registration in car repository test registration, add OnlyAllAttributes topfield selection usage
@bart-degreed bart-degreed mentioned this pull request Nov 6, 2020
@bart-degreed
Copy link
Contributor

Continued in #874.

@bart-degreed bart-degreed deleted the feat/post-relationship-link-353 branch November 10, 2020 20:18
maurei added a commit that referenced this pull request Nov 17, 2020
* Enhancements in create/update/delete

Continuation of #851.

* Various cleanups based on diff with master.

* refactor: reduced ResourceService dependencies

* refactor: move logic from GetResourcesByIds to composer

* Refactor: remove IGetResourcesByIds

* Replace repo.GetPrimaryResourceForCompleteReplacement with overridable coordination from service.

* Removed IDataStoreUpdateFailureInspector dependency from repository

* Simplified code

* More refactorings

* Added services.AddResourceRepository()

* removed TODO

* Reorder methods in calling order, renames, expose FlushFromCache/SaveChangesAsync

* Removed ThroughEntitiesFilter

* Renames

* Extract responsibilities

* Added tracking TODOs

* formatting

* TODO

* Added tests for obfuscated IDs

* Added marker to our TODOs

* Added documentation

* Tests for cyclic relationships

* Folder rename

* Migrated left-over tests

* Change casing of .sln (1/2)

* Change casing of .sln (2/2)

* chore: restore toplevel related links in relationship endpoint

* Merged IntegrationTests project

* Added tests for 0 or empty string as primary key value

* Removed TODO

* tests: pagination on relationship endpoint

* Fixes and more tests for handling zero/empty primary key

* added check for related link

* Fixes for proper error on relationship kind mismatch (HasOne vs HasMany)

* Removed empty folder

* tests: added required relationship tests, changed existing tests to display better assertion failures if they would have covered required relationships

* Improved purging of change tracker

* Replaced dependency on IResourceRepository with IResourceRepositoryAccessor

* Move logic around to reduce dependencies in SecondaryResourceResolver.

* Inlined ISecondaryResourceResolver into JsonApiResourceService

* Refactorings to remove joinTableFilter parameter from ResourceRepository.AddToToManyRelationshipAsync()

* Do not fetch resource for hooks on delete (because we didn't do that for GetSecondary either).

* tests: required relationships

* feat: throw CannotClearRequiredRelationshipException

* chore: self review

* refactor: EF Core null assignment change tracker trick no longer required

* refactorings

* refactorings

* Added ID to error message

* chore: review todos

* Remove unused usings

* fix: minor refactor repository

* review

* removed query for jointable

* fix name

* Use generic type parameter in IResourceRepositoryAccessor

* Expose EntityFrameworkCoreRepository methods as protected to enable copy/paste Update method in derived classes

* Readme updates

* Small tweaks based on diff with master

* Fixed casing

Co-authored-by: maurei <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants