Using Telerik OpenAccess ORM I have 2 objects Userand Investment. More specifically, it Investmentscontains a foreign key for Useras is typical of many relationships. In other words, each User can have several investments, but each Investment can have only one user.
Then I tried using the "Managed" public access feature

This should mean that I can do something like this User.Investments.Clear();and delete all related investments (or at least it works great in many ways), but unfortunately, when I try to do this, I am greeted by the following error.
"Update failed: Telerik.OpenAccess.RT.sql.SQLException: cannot insert a NULL value in the 'UserID" column, the table' CODECorp.dbo.Investment '; the column does not allow zeros. UPDATE cannot. "
Obviously, ORM is trying to remove the association (i.e. the foreign key) from the investee, rather than removing it. I confirmed this by running the SQL profiler and seeing that it works Update, not Delete.
So what am I missing here? Why is it incorrectly trying to remove the association, and not just delete the row as you expected?
source
share