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

[Breaking] Make collections read-only #126

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

zbyszekprasak
Copy link

@zbyszekprasak zbyszekprasak commented Nov 15, 2024

Hello!

I have read that there was already two attempts to make objects immutable: #9 and #26. I propose third solution: replacing List<Error> with ReadOnlyCollection<Error> in ErrorOr.Errors and Dictionary<string, object> with ReadOnlyDictionary<string, object> in Error.Metadata property.

It should not change much for existing code and does not have pitfall regarding lack of implicit conversion from interface. I was very focused not to break anything. I believe very conservative changes in unit tests proves that.

@amantinband please take a look and let me know if it is acceptable to put it in 3.0.0 version.

Changed project version to 3.0.0-alpha.1
Added CHANGELOG entries for read-only error collection and read-only error metadata
@zbyszekprasak zbyszekprasak force-pushed the breaking/make-collections-read-only branch from bd1c3d2 to e25e460 Compare November 15, 2024 23:02
@zbyszekprasak zbyszekprasak marked this pull request as ready for review November 15, 2024 23:25
@zbyszekprasak zbyszekprasak changed the title [Breaking] Make collections read only [Breaking] Make collections read-only Nov 15, 2024
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.

1 participant