griffin.mvccontrib

Griffin localization and Fluent Validation

二次信任 提交于 2020-01-17 07:08:11
问题 I am new to Griffin localization, it seems very cool. However, examples are only showing me how to translate MVC validation attributes. I am using minimum if not none of the mvc validation attributes. My idea is (try) not to validate and report messages twice at data layer and UI layer. I create validators at data layer with with Fluent Validation. Could you please give me a quick pointer (if it exists) how we can integrate Griffin Localization with Fluent Validation at data layer? 回答1:

RegularExpression Message Error Using Griffin.MvcContrib

烈酒焚心 提交于 2019-12-11 13:17:16
问题 I'm using Griffin.MvcContrib for metadata message errors validation. I have Added a custom validation to add a regular expression validation: protected override IEnumerable<ModelValidator> GetValidators(ModelMetadata metadata, ControllerContext context, IEnumerable<Attribute> attributes) { List<ModelValidator> vals = base.GetValidators(metadata, context, attributes).ToList(); //if (metadata.ModelType.Name == "DateTime") if (metadata.DataTypeName == "telephone") {