title: Magento 2 Add product to category (code)
body: <p>I want to create products by their code, and I want to add products to categories.<br>
  How to add products to categories by code?<br>
  I tried to add category to product <code>\Magento\Catalog\Model\Product</code>, but there no method setCategory or something like that.<br>
  Then I tried to add products to category <code>Magento\Catalog\Model\Category</code>, and there no method addProduct or something like that. 
    I saw function </p>
  
  <pre><code>CategoryLinkManagementInterface -&gt; assignProductToCategories(
  $product-&gt;getSku(),
  $product-&gt;getCategoryIds() //but there is not categories yet
  )
  </code></pre>