This could even be a simple question even a school boy can answer.
What is the similarities and differences between "ForEach" and "Using" (asked in an interview).
My assumption was
1)Both are enumerable
2) Using can handle memory resources,but foreach can't.using supports IDisposable,foreach can't.
I wish to know the answers.
foreach will dispose of your IEnumerable if it implements IDisposable.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With