Timeline for LINQ foreach - error handling and general improvement
Current License: CC BY-SA 3.0
4 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Dec 23, 2014 at 17:48 | comment | added | moarboilerplate | I should also note that you lucked out in that you are enumerating over the collection using FirstOrDefault. If you weren't, like for example if you were setting the value equal to the results returned by Where(), deferred execution would probably make all of your i's equal to all of the j's returned in the last i's query. Tread lightly when modifying values in a foreach! | |
Dec 23, 2014 at 16:34 | comment | added | Force444 | Thank you. Very interesting! I'm looking forward to try out your ideas. Might have a question or two when I do that. I could also try some before/after benchmarking to see a potential difference. | |
Dec 23, 2014 at 16:24 | vote | accept | Force444 | ||
Dec 23, 2014 at 16:02 | history | answered | moarboilerplate | CC BY-SA 3.0 |