How can I use a local variable to bring out a method extension?

As mentioned, I want to reuse a locally declared variable and use its value in the extension method.

Example

protected boolean checkTaxCodesByLine()
{
    TaxCode lastTaxCode;
    lastTaxCode = taxWorkTrans.TaxCode;
}

Extension method

public TaxTable taxTable;
protected boolean checkTaxCodesByLine()
{
    next checkTaxCodesByLine() ;
    taxTable = this.getTaxTable(lastTaxCode);

    return true;
}

It’s not possible. The variable is both created a ceased to exist inside the call of next checkTaxCodesByLine(), therefore it simply doesn’t exist in any of your code.