I have the following piece of test code and want to access the variable result outside the enclosing lambda expression. Obviously this does not work as result is always null? I have Googled around a bit but seem to got myself more confused. What are my options?
RequestResult result = null;
RunSession(session =>
{
result = session.ProcessRequest("~/Services/GetToken");
});
result //is null outside the lambda
EDIT - more information below
The RunSession method has the following signature
protected static void RunSession(Action<BrowsingSession> script)