Example #1
0
        private void WriteSchemas()
        {
            // TODO: for referenced model - write alias as is, instead of writing its namespace.
            EdmModelCsdlSerializationVisitor visitor;
            Version edmVersion = this.model.GetEdmVersion() ?? EdmConstants.EdmVersionLatest;

            foreach (EdmSchema schema in this.schemas)
            {
                var schemaWriter = new EdmModelCsdlSchemaXmlWriter(model, this.writer, edmVersion);
                visitor = new EdmModelCsdlSerializationVisitor(this.model, schemaWriter);
                visitor.VisitEdmSchema(schema, this.model.GetNamespacePrefixMappings());
            }
        }
Example #2
0
        internal static void WriteSchemas(IEdmModel model, IEnumerable <EdmSchema> schemas, Func <string, XmlWriter> writerProvider)
        {
            EdmModelCsdlSerializationVisitor visitor;
            Version edmVersion = model.GetEdmVersion() ?? EdmConstants.EdmVersionDefault;

            foreach (EdmSchema schema in schemas)
            {
                XmlWriter writer = writerProvider(schema.Namespace);
                if (writer != null)
                {
                    var schemaWriter = new EdmModelCsdlSchemaXmlWriter(model, writer, edmVersion);
                    visitor = new EdmModelCsdlSerializationVisitor(model, schemaWriter);
                    visitor.VisitEdmSchema(schema, model.GetNamespacePrefixMappings());
                }
            }
        }