I was porting some code over to work with a Windows Store App and noticed that the List<T>.ForEach
method isn't included in the .NET Core framework (the framework referenced by Windows Store Apps).
MSDN confirms that it is not supported for Store Apps.
I can easily get around the missing method, but at this point I'm just curious why it's missing.
I can easily get around the missing method, but at this point I'm just curious why it's missing.
I suspect it was deemed unnecessary bloat which arguably would have been better not in the framework to start with, as using foreach
is usually cleaner.
Indeed, from the link at the bottom of that blog post, MSFT provides an answer in the MSDN forums:
List<T>.ForEach
has been removed in Metro style apps. While the method seems simple it has a number of potential problems when the list gets mutated by the method passed to ForEach. Instead it is recommended that you simply use a foreach loop.
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