Magento2 : How to get equivalent class of "Mage::getModel('tax/calculation')"?

in your block file

protected  $calculation;



public function __construct(
\Magento\Backend\Block\Template\Context $context,
\Magento\Tax\Model\Calculation $calculation,
.........   
) {
...........
 $this->calculation = $calculation;
...........
}

public function yourmethod()
{
  $taxCalculation = $this->calculation;
  $request        = $taxCalculation->getRateRequest(null, null, null, $store);
  $taxClassId     = $_product->getTaxClassId();
  $percent        = $taxCalculation->getRate($request->setProductClassId($taxClassId));
 }

Tags:

Magento2

Tax