Luke Smith
Luke Smith

Reputation: 24254

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?

Upvotes: 1

Views: 1508

Answers (2)

E-Riz
E-Riz

Reputation: 32924

It is definitely supported, both in XML mapping and in Fluent NHibernate.

Upvotes: 1

Alun Harford
Alun Harford

Reputation: 3124

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

You can just set the property in your constructor though.

Upvotes: 1

Related Questions