I want to modify a local variable in a function of extension method. See
int myvar=0;
MyList.Where(
x =>
{
if (condition)
myvar += 1;
return false;
});
return myvar;
Why that is not working?