/// <summary> /// Validate the <see cref = "EdmModel" /> and all of its properties given certain version. /// </summary> /// <param name = "root"> The root of the model to be validated </param> /// <param name = "validateSyntax"> True to validate the syntax, otherwise false </param> internal void Validate(Edm.EdmModel root, bool validateSyntax) { // Build up the validation context var context = new EdmModelValidationContext(validateSyntax); context.OnError += OnError; context.Validate(root); }
internal static void Validate(EdmModel validateRoot, EdmModelValidationContext context) { var edmModelValidationRuleSet = EdmModelRuleSet.CreateEdmModelRuleSet(context.ValidationContextVersion, context.ValidateSyntax); var modelVisitor = new EdmModelValidationVisitor(context, edmModelValidationRuleSet); modelVisitor.Visit(validateRoot); }
/// <summary> /// validate the <see cref = "EdmModel" /> from the root with the context /// </summary> /// <param name = "validateRoot"> The root to validate from </param> /// <param name = "context"> The validation context </param> internal static void Validate(EdmModel validateRoot, EdmModelValidationContext context) { // build up the rule set and the visitor var edmModelValidationRuleSet = EdmModelRuleSet.CreateEdmModelRuleSet( context.ValidationContextVersion, context.ValidateSyntax); var modelVisitor = new EdmModelValidationVisitor(context, edmModelValidationRuleSet); modelVisitor.Visit(validateRoot); }
internal EdmModelValidationVisitor(EdmModelValidationContext context, EdmModelRuleSet ruleSet) { _context = context; _ruleSet = ruleSet; }