Skip to content

Provide a waning when `ValidationRuleCollection.Add` is used wrong

I did this today:

Rules.Add(() => ValidatedValue > 0, $"{nameof(ValidatedValue)} must be greater than 0.");

It seems that i forgot to add nameof(ValidatedValue) at the end. In order to help the developer write the right code, it is probably best if we add an overload that results in a warning if no parameters is added to Rules.Add.

Edited by Vivienne Spence