有没有办法防止此FluentValidation上的堆栈溢出?

时间:2014-12-02 22:05:06

标签: fluentvalidation

我有以下验证,我无法以任何方式获取stackOverflow。有什么办法吗?

public GridLayoutModelValidator()
    {
       //some validations
       RuleFor(layout => layout.Rows).NotEmpty().SetCollectionValidator(new GridLayoutRowModelValidator());
    }
}

public class GridLayoutRowModelValidator : AbstractValidator<GridLayoutRowModel>
{
    public GridLayoutRowModelValidator()
    {
        //some validations
        RuleFor(row => row.Modules).Cascade(CascadeMode.Continue).NotEmpty()
            .SetCollectionValidator(new GridLayoutModuleDataModelValidator());
    }
}

public class GridLayoutModuleDataModelValidator : AbstractValidator<GridLayoutModuleDataModel>
{
    public GridLayoutModuleDataModelValidator()
    {
        //some validations
        RuleFor(module => module.Rows).SetCollectionValidator(new GridLayoutRowModelValidator());      
    }
}

1 个答案:

答案 0 :(得分:0)