Timeline for Convert Foreach Loop into Linq in C#
Current License: CC BY-SA 3.0
14 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
May 24, 2016 at 8:30 | vote | accept | Abb | ||
Nov 20, 2015 at 7:46 | vote | accept | Abb | ||
May 24, 2016 at 8:30 | |||||
Sep 22, 2015 at 15:31 | comment | added | Phylogenesis | @Berend I agree. There's a few answers trying to replicate the exact loops presented, but this can surely be replaced by a single XPath query and looping over the results. | |
Sep 22, 2015 at 14:11 | comment | added | Berend | Could you perhaps provide a sample XML file? Judging by your code I suspect that it may be easier to use an XPath expression. | |
Sep 22, 2015 at 11:54 | vote | accept | Abb | ||
Sep 22, 2015 at 11:54 | |||||
Sep 22, 2015 at 8:46 | comment | added | ChrisWue |
I haven't tried it but you should be able to use LINQ to XML and simply get all CONDITION nodes, something along these lines XDocument.Load(new StreamReader(manifestFileName)).Descendants("Condition") this would turn your 7 nested loops int o a single line. Might not work with the data you have but could be worth a shot.
|
|
Sep 22, 2015 at 7:58 | answer | added | BCdotWEB | timeline score: 4 | |
Sep 22, 2015 at 7:34 | answer | added | Mark Shevchenko | timeline score: 11 | |
Sep 22, 2015 at 7:34 | answer | added | aydjay | timeline score: 2 | |
Sep 22, 2015 at 7:18 | history | edited | BCdotWEB | CC BY-SA 3.0 |
added 168 characters in body
|
S Sep 22, 2015 at 7:17 | history | edited | abuzittin gillifirca | CC BY-SA 3.0 |
code format
|
Sep 22, 2015 at 7:16 | review | Suggested edits | |||
S Sep 22, 2015 at 7:17 | |||||
Sep 22, 2015 at 7:01 | review | First posts | |||
Sep 22, 2015 at 7:18 | |||||
Sep 22, 2015 at 6:59 | history | asked | Abb | CC BY-SA 3.0 |