Beispiel #1
0
        internal void ValidateAndCompileMappings(EntityDesignArtifactSet artifactSet, bool doEscherValidation)
        {
            var artifact = artifactSet.GetEntityDesignArtifact();

            // XSD prevents an EDMX from having both a DataServices node and a Runtime node
            // don't validate DataServices
            if (artifact != null &&
                artifact.DataServicesNodePresent)
            {
                return;
            }

            if (doEscherValidation)
            {
                EscherModelValidator.ValidateEscherModel(artifactSet, false);
            }
            else
            {
                EscherModelValidator.ClearErrors(artifactSet);
                if (artifact != null)
                {
                    artifact.SetValidityDirtyForErrorClass(ErrorClass.Escher_All, true);
                }
            }

            // validate using the schema version of this artifact as the target Entity Framework version
            new RuntimeMetadataValidator(this, artifactSet.SchemaVersion, DependencyResolver.Instance)
            .ValidateAndCompileMappings(artifactSet, artifactSet.ShouldDoRuntimeMappingValidation());
        }
        internal void ValidateAndCompileMappings(EntityDesignArtifactSet artifactSet, bool doEscherValidation)
        {
            var artifact = artifactSet.GetEntityDesignArtifact();

            // XSD prevents an EDMX from having both a DataServices node and a Runtime node
            // don't validate DataServices
            if (artifact != null
                && artifact.DataServicesNodePresent)
            {
                return;
            }

            if (doEscherValidation)
            {
                EscherModelValidator.ValidateEscherModel(artifactSet, false);
            }
            else
            {
                EscherModelValidator.ClearErrors(artifactSet);
                if (artifact != null)
                {
                    artifact.SetValidityDirtyForErrorClass(ErrorClass.Escher_All, true);
                }
            }

            // validate using the schema version of this artifact as the target Entity Framework version
            new RuntimeMetadataValidator(this, artifactSet.SchemaVersion, DependencyResolver.Instance)
                .ValidateAndCompileMappings(artifactSet, artifactSet.ShouldDoRuntimeMappingValidation());
        }