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:
- Implement business logic on the DataContext level - by overriding SaveChanges method
- Implement business logic for each entity using OnPropertyChanging partial method
- Wrap the generated code in a custom class that implement the validation layer.
Which method is best practice when managing business logic on Entity Framework