title: How do i use navigation properties correctly EF?
body: <p>Below is a POCO class i set up with Entity Framework Code first.  How can i Query my database so that I can return all brands of a specific category?</p>
  
  <p>Example: You have a list of categories and you click on one.  It shows all brands of products available under that category.  </p>
  
  <p>I don't know if my classes are set up correctly to do this. </p>
  
  <pre><code>  public class Product
      {
          [Key,ScaffoldColumn(false)]
          public int ProductID { get; set; }
  
  
          public string ProductName { get; set; }
  
          public int? CategoryID { get; set; }
  
          public virtual Category Category { get; set; }
  
  
          public int? BrandID { get; set; }
  
          public virtual Brand Brand { get; set; }
  
  
      }
  
  
     public class Brand
      {
  
          [ScaffoldColumn(false)]
          public int BrandID { get; set; }
  
  
          public string BrandName { get; set; }
  
      }
  
  
      public class Category
      {
          [ScaffoldColumn(false)]
          public int CategoryID { get; set; }
  
          public string CategoryName { get; set; }
  
          public virtual ICollection&lt;Product&gt; Products { get; set; }
  
  }
  </code></pre>