// 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 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);
                    }
                }
            }
        }
Esempio n. 3
0
 internal static void ClearErrors(EFArtifactSet artifactSet)
 {
     artifactSet.ClearErrors(ErrorClass.Escher_All);
 }