vb.net - ASP.NET MVC - Can't set overrideable property = nothing? -


let's have following entities:

public class dodo     public property id integer      public property name string      public overridable property mother dodomother end class  public class dodomother     public property id integer      public property name string      public property age integer end class 

i need able set dodo.mother nothing once it's been set.

i.e.

dim ndodo dodo = db.dodos.find(1) ndodo.mother = nothing db.savechanges() 

when execute above code, don't error or exception or indicate statement hasn't worked. ndodo object doesn't seem set mother null , db doesn't updated.

am doing wrong? tried adding db.entry(ndodo).state = entitystate.modified didn't work either.

you need add id property dodo dodomother , set nothing.

public property motherid integer? 

your property 'mother' navagation property. navagation properties not part of database tables, part of entity classes.


Comments

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -