the two functions
the errors that they return
I’m using Visual Studio 2019
I tried re-writing these functions in different places in the code, it changed nothing.
the two functions
the errors that they return
I’m using Visual Studio 2019
I tried re-writing these functions in different places in the code, it changed nothing.
2
Answers
You need to move the second return outside of the
foreach
– the way it’s written – it will always return after the first element, and does not return anything if the collection is empty (which is the reason for the error).If you paste the code as text instead of images, I can give the exact correct code.
Please see the corrected code below: