Skip to content

Switch ValidateContext.ValidationErrors to IReadOnlyList<string> instead of IEnumerable<string>#67659

Merged
Youssef1313 merged 3 commits into
mainfrom
dev/ygerges/readonlylist
Jul 8, 2026
Merged

Switch ValidateContext.ValidationErrors to IReadOnlyList<string> instead of IEnumerable<string>#67659
Youssef1313 merged 3 commits into
mainfrom
dev/ygerges/readonlylist

Conversation

@Youssef1313

Copy link
Copy Markdown
Member

Related to #66980

Copilot AI review requested due to automatic review settings July 8, 2026 07:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates Microsoft.Extensions.Validation.ValidateContext’s ValidationErrors value type from IEnumerable<string> to IReadOnlyList<string> to better reflect the concrete, materialized error collection shape and avoid exposing potentially lazy / multi-enumeration semantics.

Changes:

  • Change ValidateContext.ValidationErrors to IReadOnlyDictionary<string, IReadOnlyList<string>>?.
  • Update internal _validationErrors storage and helper signatures to use IReadOnlyList<string> consistently.

Comment thread src/Validation/src/ValidateContext.cs
Comment thread src/Validation/src/ValidateContext.cs
Comment thread src/Validation/src/ValidateContext.cs
@Youssef1313 Youssef1313 merged commit 7645238 into main Jul 8, 2026
25 checks passed
@Youssef1313 Youssef1313 deleted the dev/ygerges/readonlylist branch July 8, 2026 10:26
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.

3 participants