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

Add CurrentValues.SetValuesExcept() #23365

Open
Tracked by #22954
urza opened this issue Nov 17, 2020 · 1 comment
Open
Tracked by #22954

Add CurrentValues.SetValuesExcept() #23365

urza opened this issue Nov 17, 2020 · 1 comment

Comments

@urza
Copy link

urza commented Nov 17, 2020

In my asp.net core + ef core I am using this update mechanism a lot:
_context.Entry(existing).CurrentValues.SetValues(received);

Many times I want to update only some properties of the object.
There are several ways how this can be accomplished.. creating and sending ViewModel, setting the properties manually instead of using the CurrentValues.SetValues or overriding the values of some properties manually.
These all works, but they add some complexity.
I would love to have something like:

SetValuesExcept("PropertyX", "PropertyY")

that would update all properties on my object except PropertyX and PropertyY.

@urza urza changed the title Suggetion: CurrentValues.SetValuesExcept() Suggestion: CurrentValues.SetValuesExcept() Nov 17, 2020
@ajcvickers
Copy link
Member

Note from triage: having some form of exclusion list could be useful here. We will need to discuss design and API.

@ajcvickers ajcvickers added this to the Backlog milestone Nov 20, 2020
@AndriySvyryd AndriySvyryd changed the title Suggestion: CurrentValues.SetValuesExcept() Add CurrentValues.SetValuesExcept() Jan 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants