Search code examples
nhibernatefluent-nhibernatenhibernate-mapping

Is it possible to set a default value on a property with NHibernate


I'm using Fluent NHibernate for my mappings and the SchemaExport class to the database schema.

Is it possible with NHibernate to set a default value for a property/column in the generated database schema?


Solution

  • Not to my knowledge, no - not in the generated schema.

    You can just set the property in your constructor though.