Skip to content
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

[WIP] Handling patch automatically #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

RichardsonWTR
Copy link

In response to #76
This is a implementation to handle a PATCH request automatically.
This library is very powerful but having to handle a PATCH request by manually updating every field looks bad.

This PR introduces the UpdateResource method to DocumentContext as an extension method.
Method signature:

UpdateResource<TResource>(this DocumentContext ctx, Document document, TResource resourceToBeUpdated)

Which fields can be updated

Supported attributes

  • DateTime
  • string
  • int
  • float
  • double (loses precision)
  • ... assume others not supported

Supported Relationships

  • to-one relationships
  • to- many relationships

P.S:
This is just a naive implementation. Feel free to criticize and suggest alternatives.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant