I have a class with a property that returns a function.
public class Demo
{
public Func<string,int,bool> Something { get; set; }
}
If I do like this
Demo demo = new Demo();
string target;
demo.Something = (a,b)=>
{
//in here `a` contains a value.
//and I want to do:
target = a;
return true;
};
//later in the code target is null
//target here is null instead of having the value of `a`
How do I assign the value of a to target variable within the lambda to reuse it later in code?