public IAsyncEnumerable <XmlDocument> GetAsyncChunks(string fileName) { return(new XmlDataFilesAsyncEnum(() => { var readStream = DataFilesStorage.GetReadStream(fileName); return XmlReader.Create(readStream, GetReaderSettings()); })); }
public async Task <bool> ValidateXmlFile(string fileName) { var settings = GetReaderSettings(); using var st = DataFilesStorage.GetReadStream(fileName); using var reader = XmlReader.Create(st, settings); var result = true; try { while (await reader.ReadAsync()) { } } catch (Exception ex) { result = false; } reader.Dispose(); await st.DisposeAsync(); return(result); }