Commit 22134c5c authored by Almouhannad's avatar Almouhannad

(B) Reafctor validation bases and add comments

parent a406f08e
......@@ -2,9 +2,10 @@
public interface IValidationResult
{
public static readonly Error ValidationError = new("ValidationError", "القيم المدخلة غير صالحة");
public static readonly Error ValidationError
= new("ValidationError", "القيم المدخلة غير صالحة");
#region Properties
Error[] Errors { get; }
#endregion
#region Properties
Error[] Errors { get; }
#endregion
}
......@@ -6,7 +6,13 @@ public class ValidationResult : Result, IValidationResult
: base(false, IValidationResult.ValidationError) =>
Errors = errors;
#region Properties
public Error[] Errors { get; }
#endregion
#region Static factory
public static ValidationResult WithErrors(Error[] errors) => new(errors);
#endregion
}
......@@ -6,7 +6,12 @@ public class ValidationResult<TValue> : Result<TValue>, IValidationResult
: base(default, false, IValidationResult.ValidationError) =>
Errors = errors;
#region Properties
public Error[] Errors { get; }
#endregion
#region Static factory
public static ValidationResult<TValue> WithErrors(Error[] errors) => new(errors);
#endregion
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment