Fluent nHibernate AutoMapping & ID Generation Scheme
How can I use Fluent NHibernate (with AutoMappin开发者_高级运维g) 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
you should use conventions.
this way you can define default behaviour which would be applied to all your classes (or conditionally, if needed).
精彩评论