James
James

Reputation: 7897

Fluent nHibernate AutoMapping & ID Generation Scheme

How can I use Fluent NHibernate (with AutoMapping) to configure the default ID generation scheme to Guid.Comb? I can see that I could specify in each entity (or a base class) the following code:

Id(entity => entity.Id, "Id").GuidComb();

Which is fine. However this doesn't so much seem to be setting the default behavior as overriding it. I just want to know if I am missing a configuration trick.

Thanks for any help

Upvotes: 2

Views: 1069

Answers (1)

J. Ed
J. Ed

Reputation: 6742

you should use conventions.
this way you can define default behaviour which would be applied to all your classes (or conditionally, if needed).

Upvotes: 1

Related Questions