Handling Validation Result
The ValidationResult
class represents the outcome of a validation process, encapsulating all validation messages and property-specific results. ValidationResult
allows you to evaluate whether validation succeeded, access detailed validation messages, and work with property-specific outcomes.
Designed for performance and memory efficiency, ValidationResult
utilizes a memory pool for allocation. Disposing of the object returns it to the pool, helping minimize unnecessary allocations and garbage collection overhead.
ValidationResult is Disposable!
FAQ
Do I Have to Call Dispose?
ValidationResult
is an object sourced from a memory pool. While disposing of it is recommended, it is not strictly required. When disposed, the ValidationResult
is promptly returned to the pool. If not disposed, it will be handled by the Garbage Collector and resurrected during finalization. Although this ensures the object eventually returns to the pool, it can lead to unnecessary memory usage and increased overhead.
Last updated