protected void Page_Load(object sender, EventArgs e)
{
int k = 0;
Func<int> p5 = () => { return k++; };
}
public int IntProducer()
{
return x++;
}
i am not able to call the function IntProducer(), is the syntax wrong ?
You were never able to call the function because you never attempted to call it directly or indirectly.
If you wanted to call it, first you must store function in the variable then call the variable like you would any other method.
Alternatively you could create a lambda function to call it too.