Exemplo n.º 1
0
        /// <summary>
        ///     Serialize the <see cref="DbModel" /> to the XmlWriter
        /// </summary>
        /// <param name="databaseMapping"> The DbModel to serialize </param>
        /// <param name="xmlWriter"> The XmlWriter to serialize to </param>
        public virtual bool Serialize(DbDatabaseMapping databaseMapping, XmlWriter xmlWriter)
        {
            Check.NotNull(databaseMapping, "databaseMapping");
            Check.NotNull(xmlWriter, "xmlWriter");

            var schemaWriter = new MslXmlSchemaWriter(xmlWriter, databaseMapping.Model.SchemaVersion);

            schemaWriter.WriteSchema(databaseMapping);

            return(true);
        }
            public Fixture()
            {
                _stringBuilder = new StringBuilder();

                _xmlWriter = XmlWriter.Create(
                    _stringBuilder,
                    new XmlWriterSettings
                {
                    OmitXmlDeclaration = true,
                    Indent             = true
                });

                Writer = new MslXmlSchemaWriter(_xmlWriter, 3.0);
            }