As you guys already know that we used to have this below method in magento to save a specific attribute value like this.
// saving product attribute
$product = Mage::getModel('catalog/product')->load('id here');
$product->setName('your name here');
$product->getResource()->saveAttribute($product, 'name');
or
// saving customer attribute
$customer->setData($attrCode, $value)->getResource()->saveAttribute($customer, $attrCode);
Can anyone let me know the alternative of the above in Magento2 .