私のコードは次のようなものです:
HttpFileCollection files
各ファイルをループしてfile.ContentLengthを合計する代わりに、すべてのコンテンツの全長を取得します。
int totalLength = 0;
for (int i = 0; i < files.Count; i++)
{
totalLength += files[i].ContentLength;
}
ラムダ式でこれを行う方法はありますか?のようなものがあります。
int totalLength = files.[some sort of delegate here to do the addition].
前もって感謝します。
編集:HttpFileCollectionにはGetEnumeratorMethodがありますが、ラムダ式を使用するにはIEnumerableを実装する必要がありますか?