title: Entity Framework Lazy and Eager loading returns System.Data.Entity.DynamicProxies.PropertyName
body: <p>I am learning Entity framework using Code First approach. I have two clases with a relationship of one to many:</p>
  
  <pre><code>public class Product
  {
      [Key] 
      public int ProductID { get; set; } 
      public string ProductName { get; set; }
  
      //Foreign Key -----&gt; To establish relationship btw two tables.
      public int CategoryID { get; set; }
      // A product belongs to a ----&gt; Category
      public virtual ProductCategory Category { get; set; }
  
  }
  
  public class ProductCategory
  {
      [Key] //PK
      public int CategoryID { get; set; }
      public string CategoryName { get; set; }
      // A Category ----&gt; has many products (List of Products)
      public virtual List&lt;Product&gt; ProductList { get; set; }    
  }
  </code></pre>
  
  <p>My DbContext class:</p>
  
  <pre><code>class ModelDBEntitiesContext2 : DbContext
  {
      public ModelDBEntitiesContext2()
      {
          //turns off easy loading for all Entities---&gt; use Eager loading to load related Entities by using "Include"
          this.Configuration.LazyLoadingEnabled = false;
      }
  
      public DbSet&lt;Product&gt; products { get; set; }
      public DbSet&lt;ProductCategory&gt; categories { get; set; }
  }
  </code></pre>
  
  <p>I use linq method syntax to query for all the Products and all the Products with their category using the INCLUDE (Eager Loading) word as follow:</p>
  
  <pre><code> ModelDBEntitiesContext2 db = new ModelDBEntitiesContext2();
   var pppp = db.products.Include(c =&gt; c.Category).ToList();
  
   //I bind it to a datagrid view            
   dataGridView.DataSource = pppp;
  </code></pre>
  
  <p>The result of both query on the dataGridView shows the Customer's column return   <code>System.Data.Entity.DynamicProxies.ProductCategory</code>
  <a href="https://i.stack.imgur.com/cG98F.png" rel="nofollow noreferrer">DataGridView Result</a></p>
  
  <p>What am I really doing wrong? Why I can't retrieve the Category with all the Products even using the Include.</p>