Ejemplo n.º 1
0
 /// <summary>
 /// Reads the specified XML stream for a Database schema.
 /// </summary>
 /// <param name="xmlStream">The XML stream.</param>
 /// <param name="validationErrors">The validation errors.</param>
 /// <returns></returns>
 public static Database Read(Stream xmlStream, IList<string> validationErrors)
 {
     using (Stream xsdStream = OpenXsd())
     using (XmlReader xmlReader = OpenXml(xmlStream, xsdStream, validationErrors))
     {
         var xmlSerializer = new DatabaseSerializer();
         var dbml = (Database)xmlSerializer.Deserialize(xmlReader);
         return dbml;
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Writes the specified XML stream.
 /// </summary>
 /// <param name="xmlStream">The XML stream.</param>
 /// <param name="dbml">The DBML.</param>
 public static void Write(Stream xmlStream, Database dbml)
 {
     var xmlSerializer = new DatabaseSerializer();
     xmlSerializer.Serialize(xmlStream, dbml);
 }