开发者

Primary Key Names in Fluent Nhibernate

开发者 https://www.devze.com 2022-12-26 20:52 出处:网络
Is there a way in Fluent NHibernate (or possibly NHibernate in general) to tell it to generate the primary keys differently?It creates the column name for the key fine, but the index/cons开发者_开发知

Is there a way in Fluent NHibernate (or possibly NHibernate in general) to tell it to generate the primary keys differently? It creates the column name for the key fine, but the index/cons开发者_开发知识库traint gets weird generated names like:

PK__Address__3214EC2725332734

PK__CreditCa__3214EC2756CA82C8

etc.

I can use straight SQL to rename them but I'd rather not.


This is a similar question to this:

Fluent NHibernate primary key constraint naming conventions

It doesn't seem possible to do it because NHibernate itself doesn't support it.

(I was irked to find out).


You should be able to name all constraints thus:

http://marcinobel.com/index.php/fluent-nhibernate-conventions-examples/

Hope this helps, I checked with some colleagues...

0

精彩评论

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