title: Best practice to implement business logic validation - Entity Framework
body: <p>I'm using Entity Framework for the first time, and I need to add business logic before inserting new objects into the db, here are the options I thought about:</p>
  
  <ol>
  <li>Implement business logic on the DataContext level - by overriding SaveChanges method</li>
  <li>Implement business logic for each entity using OnPropertyChanging partial method</li>
  <li>Wrap the generated code in a custom class that implement the validation layer.</li>
  </ol>
  
  <p>Which method is best practice when managing business logic on Entity Framework</p>