Entity Framework Validation with Partial Methods

Shep

New member
Joined
Jan 25, 2010
Messages
4
Programming Experience
10+
I'm validating entities in EF4.1 with the On[Property]Changing partial methods in a VS2010 Winforms project.

Example: OnJobNumberChanging(value As String)

I throw an ArgumentException in them if 'value' violates a rule.

When editing in a DataGridView which is bound to the results of an ObjectQuery, user clears the text in a cell bound to a property which is not nullable and tabs out. Code enters the partial method, exception is thrown.

Where then do I catch this exception? I am unable to find the correct event. Exception message is, "ArgumentException was unhandled by user code".

Thanks
 
Back
Top