Ejemplo n.º 1
0
        private void ModifyWithValidationGraph(ElementRequest request, HtmlTag tag)
        {
            // check for partials
            var modelType = (request.Accessor is SingleProperty) ? request.Model.GetType() : request.Accessor.OwnerType;

            var calls = _graph
                            .FindChain(modelType)
                            .CallsFor(request.Accessor.FieldName);

            calls
                .Where(call => !typeof(ComparisonValidationRule<>).IsAssignableFrom(call.RuleType))
                .Each(call => tag.Modify(t => t.AddClass(call.ToRuleDef().Name.ToLower())));

            tag.Attr("id", request.ElementId);
        }