adsense

Wednesday, January 1, 2020

FluentValidation validating bool

When validating boolean properties  using FluentValidation, use .NotNull() instead of .NotEmpty()

The reason behind this is NotEmpty() will consider only true as valid property whereas NotNull() will consider both true and false as valid properties.

Cheers
Samitha