My code has something like this:
HttpFileCollection files
Instead of looping through each file and adding up the file.ContentLength to get the total length of all content e.g.
int totalLength = 0;
for (int i = 0; i < files.Count; i++)
{
totalLength += files[i].ContentLength;
}
Is there a way I can do this with a lambda expression so I have something like..
int totalLength = files.[some sort of delegate here to do the addition].
Thanks in advance.
Edit: HttpFileCollection has a GetEnumeratorMethod but would it need to implement IEnumerable to use a lambda expression?