次のエンティティがあるとします。
Public Class Dodo
Public Property ID As Integer
Public Property Name As String
Public Overridable Property Mother As DodoMother
End Class
Public Class DodoMother
Public Property ID As Integer
Public Property Name As String
Public Property Age As Integer
End Class
Dodo.Mother を一度設定すると、何も設定できないことがあります。
いえ
Dim ndodo as dodo = db.Dodos.find(1)
ndodo.Mother = nothing
db.SaveChanges()
上記のコードを実行すると、エラーや例外、またはステートメントが機能していないことを示すものは何も表示されません。ndodo オブジェクトは Mother を null に設定していないようで、DB は更新されません。
私は何か間違ったことをしていますか?db.Entry(ndodo).State = EntityState.Modified も追加しようとしましたが、これも機能しませんでした。