// internal for testing, virtual for mocking internal virtual void ValidateArtifactSet(EFArtifactSet artifactSet, bool forceValidation, bool validateMsl, bool runViewGen) { Debug.Assert(artifactSet != null, "artifactSet != null"); Debug.Assert(!runViewGen || validateMsl, "ViewGen validation can only be performed if msl validation is requested"); // First determine if we need to do validation if (!artifactSet.IsValidityDirtyForErrorClass(ErrorClass.Runtime_All) && !forceValidation) { return; } // If we need to do validation, first clear out any existing errors on the artifact set. artifactSet.ClearErrors(ErrorClass.Runtime_All); var designArtifact = artifactSet.GetEntityDesignArtifact(); if (designArtifact != null) { var storeItemCollection = ValidateStoreModel(designArtifact); var edmItemCollection = ValidateConceptualModel(designArtifact); if (edmItemCollection != null && storeItemCollection != null && validateMsl) { var mappingItemCollection = ValidateMapping(designArtifact, edmItemCollection, storeItemCollection); if (mappingItemCollection != null && runViewGen) { ValidateWithViewGen(mappingItemCollection, designArtifact); } } } }
internal static void ValidateEscherModel(EFArtifactSet set, bool forceValidation) { // TODO: Check if the validity is dirty for certain Escher error classes and validate // only against those. For now there is no immediate need for this. if (!set.IsValidityDirtyForErrorClass(ErrorClass.Escher_All) && !forceValidation) { return; } ClearErrors(set); var artifact = set.GetEntityDesignArtifact(); if (artifact != null) { var visitor = new EscherModelValidatorVisitor(set); visitor.Traverse(artifact); artifact.SetValidityDirtyForErrorClass(ErrorClass.Escher_All, false); } }