title: EntityRef-object not refreshed after LINQ-update?
body: <p>If have 2 entity classes, ProductEntity and CategoryEntity:</p>
  
  <pre><code>[Table(Name = "Products")]
  public class ProductEntity
  {
      // Data Members
      private int _productID;
      private string _productName;
      private int _categoryID;
      private EntityRef&lt;CategoryEntity&gt; _category;
  
      // Properties
      [Column(DbType = "int", IsPrimaryKey = true, IsDbGenerated = true)]
      public int ProductID
      {
          get { return _productID; }
          set { _productID = value; }
      }
  
      [Column(DbType = "nvarchar(40)")]
      public string ProductName
      {
          get { return _productName; }
          set { _productName = value; }
      }
  
      [Column(DbType = "int")]
      public int CategoryID
      {
          get { return _categoryID; }
          set { _categoryID = value; }
      }
  
      [Association(Storage = "_category",
          ThisKey = "CategoryID",
          OtherKey = "CategoryID")]
      public CategoryEntity Category
      {
          get { return _category.Entity; }
          set { _category.Entity = value; }
      }
  }   // class ProductEntity
  
  [Table(Name = "Categories")]
  public class CategoryEntity
  {
      // Data Members
      private int _categoryID;
      private string _categoryName;
  
      // Properties
      [Column(DbType = "int", IsPrimaryKey = true)]
      public int CategoryID
      {
          get { return _categoryID; } 
          set { _categoryID = value; }
      }
  
      [Column(DbType = "nvarchar(40)")]
      public string CategoryName
      {
          get { return _categoryName; }
          set { _categoryName = value; }
      }
  }   // class CategoryEntity
  </code></pre>
  
  <p>Using LINQ I execute a Select as follows (details omitted):</p>
  
  <pre><code>DataContext _northwindCtx = new DataContext(connectionString);
   DataLoadOptions loadOptions = new DataLoadOptions();
   loadOptions.LoadWith&lt;ProductEntity&gt;
                      (ProductEntity =&gt; ProductEntity.Category);
   _northwindCtx.LoadOptions = loadOptions;
  
   Table&lt;ProductEntity&gt; productsList = 
                      _northwindCtx.GetTable&lt;ProductEntity&gt;();
   var productsQuery =
          from ProductEntity product in productsList
         where product.ProductName.StartsWith(productname)
         select product;
  
  List&lt;ProductEntity&gt; productList =  productsQuery.ToList();
  </code></pre>
  
  <p>Obtained value for the 1st record in the list is</p>
  
  <pre><code>    productList[0].ProductName          "TestProduct"   
  
      productList[0].CategoryID           1   
  
      productList[0].Category.CategoryID      "1" 
  
      productList[0].Category.CategoryName        "Beverages"
  </code></pre>
  
  <p>Then I update CategoryID to 8 
  OK, so far so good</p>
  
  <p>I reexceute the select as above.
  Obtained value for the 1st record is now</p>
  
  <pre><code>    productList[0].ProductName      "TestProduct"   
  
      productList[0].CategoryID       8                        OK
  
      productList[0].Category.CategoryID  "1"                    ??
  
      productList[0].Category.CategoryName    "Beverages"            ??
  </code></pre>
  
  <p>The CategoryID-property of ProductEntity has been updated but the Category-property not, in other words the EntityRef object has not been 'rebuild' ???</p>
  
  <p>Why not? How can i make this work?</p>
  
  <p>thank you
  Chris</p>