如何获取FluentValidation ErrorMessage Datetime格式以使用Zulu时间

时间:2018-12-04 10:59:34

标签: fluentvalidation

我正在尝试进行以下属性验证,以Zulu时间格式返回给定的时间戳。

private readonly DateTime validStartingDate = new DateTime(2000, 01, 01, 00, 00, 00, DateTimeKind.Utc);

RuleFor(model=> model.ValidFrom).NotEmpty().GreaterThan(_validStartingDate)
                    .WithMessage(ConnectionValidationMessages.ValidFromInvalidValues);

public const string ValidFromInvalidValues =
       "ValidFrom cannot be empty and should be later than {ComparisonValue}";

是否可以使用{ComparisonValue}进行任何格式化,还是应该手动格式化字符串?

0 个答案:

没有答案