title: Extending entity framework classes
body: <p>Even many Q/A on the subject, I didn't find a clear answer for this question:</p>
  
  <p>What's the best design practice for adding business rules (i.e, validations) to entity classes.</p>
  
  <p>I simply want to check some validations before setting the underlying entity value:</p>
  
  <pre><code>public Property
  {
      get { return base.Property; }
      set
      {
         // Do some validations or other business logic
         base.Property = value;
      }
  }
  </code></pre>
  
  <p>It doesn't make sense to create a new class from scratch in BLL when all properties are already there in entity class. On the other hand, entity classes need to be extended with business logic rules.</p>
  
  <p>Using interface need extra work, because a change in DAL (entity) would be reflected in both interface and BLL class.</p>
  
  <p>I'm not sure if inheriting from entity class and overriding it's properties and adding extra properties and methods is a good idea or not.</p>
  
  <p>A sample pseudo code in more helpful to me.</p>
  
  <p>Thanks</p>