title: Nhibernate inconsistent fetching behavior
body: <p>Here is my code</p>
  
  <pre><code>if (des.X == null)
  {
      if (src.IsL)
      {
          des.X = new Y();
          var l = lRepo.Find().Where(file =&gt; file.Id == src.drId).First();
          ((Y)des.X).L = l;
      }
      else
      {
  
          D d = dRepo.Get(src.DrugId);
          if (d is N)
          {
              des.X = new Y();
              ((Y)des.X).D = d;
              ((Y)des.X).L = ((N)d).L;
          }
          else
          if (d is IF)
          {
              des.X = new IeI();
              des.X.D = d;
          }
      }
  }
  </code></pre>
  
  <p>the problem happens when I ask <code>if (d is N)</code> </p>
  
  <p>At the first time when I send a create request and I send a <strong>N Id</strong> , it evaluates it as true but when I send the same data for update it evaluates it as false.</p>
  
  <p>I am a little confused and I have no logical explanation for that, so could anyone help me to resolve this issue.</p>
  
  <p>When update it returns a proxy but when creating it returns a normal entity.</p>
  
  <p>Untrack and not lazy load solutions work in this case but I do not think that they are efficient solutions.</p>
  
  <p>Any help please.</p>