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

entry.OriginalValues.SetValues swallows error #22968

Closed
AndersMalmgren opened this issue Oct 12, 2020 · 2 comments · Fixed by #25895
Closed

entry.OriginalValues.SetValues swallows error #22968

AndersMalmgren opened this issue Oct 12, 2020 · 2 comments · Fixed by #25895
Labels
area-change-tracking closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. customer-reported type-bug
Milestone

Comments

@AndersMalmgren
Copy link

AndersMalmgren commented Oct 12, 2020

SetValues has a signature of Dictionary<string, object>

its perfectly fine to send in new Dictionary<string, TProperty> but it will not update the original value correctly. So no concurrency error will trigger when saving. Since compiler does not complain you should throw some kind of runtime here to save on debugging for developers.

Thanks

@stevendarby
Copy link
Contributor

stevendarby commented May 7, 2021

Rather than throw, could the method signature be updated to take IDictionary<string, T> so it just works? I’m not sure there are likely to be many use cases where you want to pass in a string dictionary to the SetValues(object) overload. The workaround for that would be to cast it as an object. The current workaround for the opposite problem is having to recreate the dictionary, casting each value as object.

@ajcvickers is this possibly a good first issue?

@ajcvickers ajcvickers added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Sep 6, 2021
@ajcvickers
Copy link
Contributor

@stevendarby After investigating this, I think you were right. Sorry for not getting back to you.

@ajcvickers ajcvickers modified the milestones: 6.0.0, 6.0.0-rc2 Sep 8, 2021
@ajcvickers ajcvickers modified the milestones: 6.0.0-rc2, 6.0.0 Nov 8, 2021
@ajcvickers ajcvickers removed their assignment Sep 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-change-tracking closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. customer-reported type-bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants