Skip to content

Write enhancements #874

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 24 commits into from
Closed

Write enhancements #874

wants to merge 24 commits into from

Conversation

bart-degreed
Copy link
Contributor

@bart-degreed bart-degreed commented Nov 6, 2020

Continuation of #851.

This PR concerns write operations and addresses several topics:

  • Add POST/DELETE relationship endpoints, which enable to add/remove resources to/from a to-many relationship.
  • Redesign of handling updates, where we try to fetch the minimum data required to perform the operation. If the operation fails, we run additional queries to determine why and produce a descriptive error according to json:api requirements.
  • Rely more on the EF Core navigation metadata model, instead of dealing with foreign keys directly.
  • Apply the whole operation in a single SaveChanges() call, removing the need for internal transaction management.
  • Add resource change tracking for POST, similar to PATCH. Note that in practice, you'll only notice if using client-generated IDs.
  • Refactoring of tests to hit all combinations of create/update/delete for the various endpoints and relationship kinds.
  • Additional tests for corner cases like malformed request bodies, foreign key constraint violations, implicit removal in one-to-one relationships, required/optional relationships, composite foreign keys etc.

Fixes #353
Fixes #850
Fixes #852
Fixes #853
Fixes #578
Fixes #870
Fixes #790

@bart-degreed
Copy link
Contributor Author

Replaced by #875.

@bart-degreed bart-degreed deleted the write-enhancements branch November 10, 2020 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment