This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi, This is a bit silly, but I have no idea how to solve it. I have a basic BindingSource with databound controls (textbox, checkbox, ...). I also have a datanavigator set to the same bindingsource. The Add/Remove buttons are trapped so I add/remove my entity to the bindingsource and unitofwork. When I add an entity (no savechanges) and remove it, then I call savechanges I get an error that a string property cannot be null (not set in the add part). This is kinda silly because I removed the object, so no validation is required here. Also no Insert/Delete should be performed towards the database. Some users are 'stupid' and they do this kind of stuff all the time. Any ideas? Greetings, Sigurd |
|
|
It sounds like the entity has not been removed from the unit of work. When I run the following test:
(where Widget.Text has a presence validation) I see no validation errors during the SaveChanges, and no INSERT statement emitted. Can you verify that the entity is being removed from the unit of work? Are there any associations that could be causing the entity to rejoin the unit of work? What entities are in the unit of work and due to be saved just before you call save changes? (You can find this out by running |
|
|
Hi, Got it working, thanks :). Greetings, Sigurd |
|