title: How to use DbRef in LiteDB
body: <p>How to use DbRef in <a href="https://github.com/mbdavid/LiteDB" rel="nofollow">LiteDB</a>. I have classes for both <code>Customer</code> and <code>Job</code>. I want the Customer to store a list of jobs that the Customer has.</p>
  
  <p>So in the Customer class, I need to have a<code>DbRef&lt;Job&gt; Jobs</code> from what I understand. I have several issues. First, DbRef is not recognized as a type with <code>using LiteDB</code>. Second, I have no idea how to implement it</p>
  
  <p>Job.cs</p>
  
  <pre><code>namespace HMDCompare.Classes
  {
    public class Job
    {
      public int id { get; set; }
      public string name { get; set; }
    }
  }
  </code></pre>
  
  <p>Customer.cs</p>
  
  <pre><code>using LiteDB;
  
  namespace HMDCompare.Classes
  {
      public class Customer
      {
          [BsonId]
          public int Id { get; set; }
  
          public string Name { get; set; }
          public string[] Phones { get; set; }
          public bool IsActive { get; set; }
  
          public DbRef&lt;Job&gt; Jobs { get; set; }
      }
  }
  </code></pre>
  
  <p>for the DbRef I get in Visual Studio: <strong>The type or Namespace name 'DbRef' could not be found</strong>. </p>
  
  <p>I am developing in C#/ASP.net 4.5 and with LiteDB 2.0.0-rc</p>