Linq to XML treating results individually instead of listing

krzna

New Member
I'm working on a parser in C# to take data from multiple xml files and put them into my own database.Right now I have this code that works:\[code\] List<CaseFile> caseFiles = ( from e in XDocument.Load(xmlDoc).Root.Elements("application-information").Elements("file-segments").Elements("action-keys").Elements("case-file") select new CaseFile { (......)}).toList();\[/code\]This creates a list of CaseFile objects which I later send to other methods to place their data into my database. The problem with this is that I need to parse many files at once, some as big as 1GB and none smaller than 200MB so this creates a massive demand for memory.Is there a way to modify my statement so for every CaseFile it finds, it sends it instantly to the other methods instead of having to create the full list of them first?
 
Back
Top