DamianEdwards / MiniValidation

A minimalist validation library for .NET built atop the existing features in `System.ComponentModel.DataAnnotations` namespace
MIT License
321 stars 25 forks source link

Enable a way to skip recursion on a given property via an attribute #8

Closed DamianEdwards closed 2 years ago

DamianEdwards commented 2 years ago

Enable a way to decorate a complex type property so that it is skipped when doing recursive validation.

e.g.

public class SampleType
{
    [Required]
    public string Name { get; set; }

    [SkipValidation]
    public ChildType Child { get; set; }
}

public class ChildType
{
    [Required]
    public string Title { get; set; }
}