What is the best way to load Customer by Id? using customer interface or customer factory or another way ?
In most of solutions I found, it is done by directly using objectManager
(which should be never be used).
Best Way to Load Customer by Customer ID in Magento 2
customermagento-2.1magento2
Best Answer
It's always a better practice to use service contracts.
In your case I would use
\Magento\Customer\Api\CustomerRepositoryInterface
:Then in your code you can call: