prabhu wrote:
Hi,
I am talking in performance point of view. What's the best way to fetch values from EntityCollection by using for or foreach statement.
Regards
Prabhu
The difference probably isn't even measurable!
This is a good example of premature optimization. The latency involved in the network transfer between your client and the webserver will far outweigh the nanosecond or two difference between For or ForEach.
Just use the easiest one in your particular case.
If performance is really a concern, look at how your data transfer objects will be serialized across the network - that is a more likely place to be able to find a saving.
Cheers
Simon