Hi, I want to use my variable in function(x) , like MyVarible = 2
Enumerable.Range(1, 10).ToArray().Reverse.Select(Function(x) x*k)
it will throw an error: For Each: An ActivityContext can only be accessed within the scope of the function it was passed into. Object name: ‘System.Activities.CodeActivityContext’.
Yes. Select method is deferred execution. It’s unable to set in the property as it is.
So, we need to add ToArray or ToList method which have it immediate execution.