title: POCO entity framework and polymorphism
body: <p>i use Entities Framework Code First and I've next POCO classes:  </p>
  
  <pre><code> public class Product 
      {       
          public int ProductID { get; set; }
          public int Title{ get; set; }
          public int Price { get; set; }
  
          public int ProductCategoryID { get; set; }
          public virtual ProductCategory ProductCategory { get; set; }
      }
  
    public class ProductCategory 
      {
          public int ProductCategoryID { get; set; }        
          public int Title{ get; set; }
          public virtual ICollection&lt;Product&gt; Products { get; set; }
      }
  </code></pre>
  
  <p>So let the product has a simple method <code>MakeSale</code> which depends on <code>ProductCategory</code> </p>
  
  <pre><code>public int void GiveSale()
  {
    //I can do like this ...
      switch (this.ProductCategoryID)
      {
          case 1: return this.Price * 0,8;
          break;
          case 2: return 0;
          ...         
      }
   }
  </code></pre>
  
  <p>But I do not like this approach, i want use OOP and have something like this:</p>
  
  <pre><code>public class Dress : Product 
  {
    public override int void GiveSale()
     {
        return this.Price * 0,8;
     }
  }
  
  public class Shoes : Product 
  {
    public override int void GiveSale()
     {
        return 0;
     }
  }
  </code></pre>
  
  <p>How can I do this with Entities Framework and saving ease of use with my entities? </p>