i have two list , List A,List B both have same no of values.i like to pass these values as arguments and selecting returning value .here code
for(int i=0;i<A.count;i++)
{
list<int> temp=new list<int>();
temp.add(methodA(A[i],B[i]);
}
how can i do this using linq.how i do it .net framework 3.5?
Are you using .NET 4? If so, the
Zipmethod is what you want:Or using a method group conversion:
If you’re not using .NET 4, MoreLINQ has a simple implementation of
Ziptoo.