title: Magento 2 Error - Model collection resource name is not defined
body: <p>I'm going through Magento 2 tutorials and I'm having trouble getting a collection from my custom model's factory after calling the create() method. It throws an error saying the "Model collection resource name is not defined". I've already cleared /var/generation and recompiled the di.</p>
  
  <p>Company/Module/Model/Vendor.php</p>
  
  <pre><code>namespace Company\Module\Model;
  
  class Vendor extends \Magento\Framework\Model\AbstractModel {
      protected function _constructor() {
          $this-&gt;_init('Company\Module\Model\Resource\Vendor');
      }
  }
  </code></pre>
  
  <p>Company/Module/Model/Resource/Vendor.php</p>
  
  <pre><code>namespace Company\Module\Model\Resource;
  
  class Vendor extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
  {
      protected function _construct()
      {
          $this-&gt;_init(
              'company_vendor',
              'vendor_id'
          );
      }
  }
  </code></pre>
  
  <p>Company/Module/Model/Resource/Vendor/Collection.php</p>
  
  <pre><code>namespace Company\Module\Model\Resource\Vendor;
  
  class Collection extends \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection
  {
      protected function _construct()
      {
          $this-&gt;_init(
              'Company\Module\Model\Vendor',
              'Company\Module\Model\Resource\Vendor'
          );
      }
  }
  </code></pre>
  
  <p>Company/Module/Block/VendorList.php</p>
  
  <pre><code>namespace Company\Module\Block;
  
  class VendorList extends \Magento\Framework\View\Element\Template {
  
      protected $vendorFactory;
  
  
      public function __construct(\Magento\Framework\View\Element\Template\Context $context,
                                  \Company\Module\Model\VendorFactory $vendorFactory,
                                  array $data = [])
      {
          parent::__construct($context, $data);
          $this-&gt;vendorFactory = $vendorFactory;
      }
  
      public function getVendors() {
          return  $this-&gt;vendorFactory-&gt;create()-&gt;getCollection()-&gt;getItems(); //fails on getCollection()
      }
  </code></pre>
  
  <p>This is the error I get:</p>
  
  <p>1 exception(s):
  Exception #0 (Magento\Framework\Exception\LocalizedException): Model collection resource name is not defined.</p>