Hello,
I'm buidling an WPF application using the examples given in the link below as a basis:
In the example given, the uses the OnValidating partial method to invoke validation and if nessesary, throw an exception when something is not valid.
In the ADO.NET EF, there is no partial method who can allow you to do this, e.g. There is no OnValidating method to override. What there is, are partial methods like: OnPropertyChanging and OnPropertyChanged, but i believe they will be executed immidiatly when you change a property which can given problems when using databinding (i dont have experience with WPF, but as far as i can remember from winforms, a grid for example will immidiatly construct an empty instance of the model and pass in the values afterwards. Therefore throwing an exception at the very beginning because some requirements have not met (is a property set for example).
So based on that, am i just looking in the wrong direction here? is there a better way to perform validation?
Thnx in advance!