title: How can I use association in linq2db
body: <p>I try to use linq2db with firebird sql server.
  I have two tables, which have releation.</p>
  
  <pre><code>    [Table("REQUESTS")]
      public partial class Request
      {
          [Column("ID")]
          [PrimaryKey]
          public int Id { get; set; }
  
          [Column("LATEST_REQUEST_DATA_ID")]
          public int? LatestRequestDataId { get; set; }
  
          [Association(ThisKey="LATEST_REQUEST_DATA_ID", OtherKey="ID")]
          public virtual RequestData LatestData { get; set; }
      }
  
      [Table("REQUEST_DATA")]
      public class RequestData
      {
  
          [Column("ID")]
          [PrimaryKey]
          public int Id { get; set; }
  
          [Column("REQUEST_ID")]
          public int RequestId { get; set; }
      }
  
      public class RequestDb : DataConnection
      {
          public ITable&lt;Request&gt; Requests { get { return GetTable&lt;Request&gt;(); } }
          public ITable&lt;RequestData&gt; Data { get { return GetTable&lt;RequestData&gt;(); } }
      }
  
      ...
          using (var context = new RequestDb())
          {
  
              var r = context.Requests.FirstOrDefault();
              var d = context.Data.FirstOrDefault(dd =&gt; dd.Id == r.LatestRequestDataId);
              Console.WriteLine(r);
          }
  </code></pre>
  
  <p>And I get <strong>d</strong>, which have the result and after I try to get result from r.LatestData but I get <strong>r.LatestData</strong> is null
  Why did I get r.LatestData = null?</p>