Where does one put validation for external content types? Let's say one field on my ECT represents an email address that must be unique in our system. Where would I put the validation that checks to see that someone hasn't submitted an instance of the ECT with a duplicate email address? How do I bubble up validation errors so they're displayed in the SharePoint UI?
Well it depends? It can be checked in your data source (within the database / stored proc / WCF) which is where it should be as that's business logic that's domain specific. You ~could~ implement it in your custom operators, but I'm not sure that's a good idea as the reuse isn't there (if other apps are using the same data source).
As painful as it is List Validation Settings, as defined in List Settings, is actually not available for ECT, either is versioning or ratings or a whole host of other features that are applicable to lists.
As Andrew suggested though you might have to do it on the back end because there is no out of the box way to do it currently.
My understanding is you apply custom validation through the InfoPath form validation. First you generate InfoPath forms for an external list in SPD. You can then apply the validation to individual fields using InfoPath validating event and code behind.
I agree with Andrew that it would be nice to be able to apply the validation in code by throwing an exception either directly from the DB or from the .NET code. Problem is, I wasn't able to find the exception type that would display the way validation errors are displayed in the UI. Throwing an exception that generates a yellow screen of death (or a web part/list failed error message) is not an option.
I have posted an answer to a similar question on stackoverlfow.com: https://stackoverflow.com/questions/2760774/validation-for-sharepoint-2010-external-lists-external-content-types/3014365#3014365