开发者

Fluent nHibernate AutoMapping & ID Generation Scheme

开发者 https://www.devze.com 2023-04-01 05:05 出处:网络
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 followi

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).

0

精彩评论

暂无评论...
验证码 换一张
取 消