namespace NetinaShop.Common.Models.Exception;

public class ValidationException : System.Exception
{
    public ValidationException() : base("Validation has been failed")
    {

    }

    public ValidationException(params ValidationError[] validationErrors) : base($"{string.Join(",", validationErrors.Select(v => v.ErrorMessage))}")
    {

    }

    public ValidationException(List<ValidationError> validationErrors) : base($"{string.Join(",", validationErrors.Select(v => v.ErrorMessage))}")
    {

    }
}
public sealed record ValidationError(string PropertyName, string ErrorMessage);