private static string StoreItemCollectionToString(StoreItemCollection storeItemCollection, string schemaNamespace = null) { var sb = new StringBuilder(); using (var writer = XmlWriter.Create(sb)) { storeItemCollection.WriteSsdl(writer, schemaNamespace); } return(sb.ToString()); }
public static LegacyMetadata.StoreItemCollection ToLegacyStoreItemCollection( this StoreItemCollection storeItemCollection, string schemaNamespaceName = null) { Debug.Assert(storeItemCollection != null, "storeItemCollection != null"); using (var ms = new MemoryStream()) { using (var writer = XmlWriter.Create(ms)) { storeItemCollection.WriteSsdl(writer, schemaNamespaceName); } ms.Position = 0; using (var reader = XmlReader.Create(ms)) { return(new LegacyMetadata.StoreItemCollection(new[] { reader })); } } }