title: Problem accessing association from the result of a lambda query
body: <p>Has anyone had problems gettting associations to load using LINQ to SQL when your child record was loaded via a lambda query? For example:</p>
  
  <pre><code>var orderLine = db.OrderLines.
      Where(ol =&gt; ol.ID == orderLineID select ol).
      First();
  // navigate to order via the association
  var order = orderLine.GetOrder();
  </code></pre>
  
  <p>What I get basically is a null result from GetOrder(). </p>
  
  <p>But if I do this instead:</p>
  
  <pre><code>var orderLine = (from ol in db.OrderLines where ol.ID == orderLineID).First();
  var order = orderLine.GetOrder();
  </code></pre>
  
  <p>Works fine. </p>
  
  <p>What can cause this? Is this a bug?</p>
  
  <p><b>EDIT: Here's the actual code that WORKS with the Lambda expression commented out that DOESN'T WORK</b></p>
  
  <pre>
  var msg = db.Messages.Where(m => m.ID == msgID).First();
  if (msg.SentTS.HasValue) return;
  
  // Get the message recipients
  // I don't get it.. why doesn't lambda expressions work here? returns 0 results!
  // var testtos = msg.GetMessageTos.Where(mt => mt.Active);
  var tos = from mt in db.MessagesTos
            where mt.Active && mt.MessageID == msgID
            select mt;
  </pre>