For example,
RuleFor(q => q.Name).NotNull().WithMessage("Name is required");
should, in my opinion, set the IsRequired property. This is important to me because I use that property to see if I should add an asterisk to a field when auto-generating it.
Thanks,
Ryan
Comments: I have hit this same scenario in mvc5, is it a bug . RuleFor(c => c.UserName).NotEmpty(); and in the Editor template var metadata = ModelMetadata.FromStringExpression("", ViewData); var t = (metadata == null || metadata.DataTypeName == null) ? "text" : metadata.DataTypeName; if (metadata.IsRequired) { <span class="required">*</span> } if so, can i do any thing using IValidatorInterceptor.
RuleFor(q => q.Name).NotNull().WithMessage("Name is required");
should, in my opinion, set the IsRequired property. This is important to me because I use that property to see if I should add an asterisk to a field when auto-generating it.
Thanks,
Ryan
Comments: I have hit this same scenario in mvc5, is it a bug . RuleFor(c => c.UserName).NotEmpty(); and in the Editor template var metadata = ModelMetadata.FromStringExpression("", ViewData); var t = (metadata == null || metadata.DataTypeName == null) ? "text" : metadata.DataTypeName; if (metadata.IsRequired) { <span class="required">*</span> } if so, can i do any thing using IValidatorInterceptor.