public static IRuleBuilderOptions <T, string> DateValidation <T>(this IRuleBuilder <T, string> rule) { return(rule .NotEmpty() .WithMessage("Order date cannot be empty.") .MustAsync(async(orderDate, cancellation) => await ValidationHelpers.BeValidDateFormat(orderDate)) .WithMessage("Order date must be of format: d.MM.yyyy e.g. 12.02.2012")); }