I'm looking for some advice. I'm working with EF 5 and I have a generic repository which handles all of the CRUD transactions with the database. This works fine, But i want to add a "Last Gap" safeguard to ensure that the entity is valid before the Data Access Layer attempts changes in the database.

Right before I do something like this :-

```
DataLayer.Create<TEntity>(entity);

```

I want to Validate the entity and throw an exception if the validation fails.

What would you guys use as the preferred method?