How to create composite UNIQUE constraint in FluentNHibernate?

后端 未结 2 1449
逝去的感伤
逝去的感伤 2020-12-18 18:14

I know that I can Map(x => x.GroupName).WithUniqueConstraint() for a single property.

But how do create a composite unique constraint in fluent nHibe

2条回答
  •  醉梦人生
    2020-12-18 18:49

    In the latest version that I have used, it isUniqueKey("KeyName")that does this.

    Map(x => x.Something).UniqueKey("KeyName");
    Map(x => x.SomeOtherThing).UniqueKey("KeyName");
    

提交回复
热议问题