public RootModel() { SubModel = new SubModel(); Validator = new Validator(this); Validator.ValidateAll(); // call it for initial validation if required }
public Concrete() { Validator = new Validator(this) { { "Count", () => Count < 0 ? "Count should be positive." : null } }; Validator.ValidateAll(); }