Page 1 of 1

Nhibernate: Marking navigation properties as Unimplemented still results in hbm.xml generation

Posted: Wed 15 Feb 2017 01:40
by apolon
I marked some navigation properties as Unimplemented as its useful to have them stay in the model for future use but not implemented in code or in the database as yet. The code properties were not generated as expected. However, the hbm.xml file still contained information on them causing a mismatch between the code and the mapping. Shouldn't Unimplemented=true also stop generation in the hbm.xml file and the database script?

Re: Nhibernate: Marking navigation properties as Unimplemented still results in hbm.xml generation

Posted: Wed 15 Feb 2017 17:27
by Shalex
That is a designed behaviour. If you need neither code generation nor hbm.xml entry, please remove this navigation property from your model (even if the corresponding FK exists in the database).

The Unimplemented property was designed to turn off a standard code generation for the property to allow user to define his own logic in a partial class.