Gina Marano
Gina Marano

Reputation: 1813

get the methods return value within the method

I know that I can simply use a variable but out of sheer curiosity is there a way to get the return value of a method within that method.

public bool MyTest()
{
    try
    {
        return true;
    }
    finally
    {
        if (myresult == true)
           dosomething();
    }
}

Upvotes: 1

Views: 65

Answers (1)

Kaveh Shahbazian
Kaveh Shahbazian

Reputation: 13523

There is no C# syntax built-in for that.

Upvotes: 1

Related Questions