public static async IAsyncEnumerable <Release> ParseReleasesDumpStream(Stream stream, [EnumeratorCancellation] CancellationToken ct = default) { var xmlReader = CreateXmlReader(stream); await xmlReader.MoveToContentAsync().ConfigureAwait(false); xmlReader.ReadStartElement("releases"); while (true) { await xmlReader.MoveToContentAsync().ConfigureAwait(false); if (xmlReader.NodeType == XmlNodeType.EndElement) { break; } var releaseNode = await XNode.ReadFromAsync(xmlReader, ct).ConfigureAwait(false); yield return(ReleaseParser.ParseRelease((XElement)releaseNode)); } xmlReader.ReadEndElement(); }
static void Main() { ReleaseParser.Run(); ReleaseParser.GetGenres(); }