| Joined: Thu Apr 15, 2010 1:57 pm
 Posts: 9
 | 
				
					| Hello Friends,
 I came across this link from Ayende with explains the adding the manytoone property at run time to an persistent class. "http://ayende.com/Blog/archive/2008/05/01/Dynamic-Mapping-with-NHibernate.aspx"
 I have a requirement in which I have to add a manytoone property to the children class and also add onetomany property to parent class.
 
 I was able to add the manytoone as shown by Ayende but when following the similar approach for onetomany I am getting an error as "Operation is not valid due to the current state of the object".
 
 I debugged the NHibernate source code and the exception is coming from the “CheckPropertyColumnDuplication” method of “NHibernate.Mapping.PersistentClass”.  In this method there is a conditional OR check on IsUpdateable and IsInsertable properties of the new property we add to the class and these properties are throwing the exception.
 
 Can anyone help me ?
 
 Thanks
 
 
 |  |