Repository navigation
Switch ValidateContext.ValidationErrors to IReadOnlyList<string> instead of IEnumerable<string> - #67659
Conversation
…stead of `IEnumerable<string>`
There was a problem hiding this comment.
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.ValidationErrorstoIReadOnlyDictionary<string, IReadOnlyList<string>>?. - Update internal
_validationErrorsstorage and helper signatures to useIReadOnlyList<string>consistently.
|
Could we avoid exposing the mutable backing collections here? Even though the public API is Can we use |
Related to #66980