使用 Fluent NHibernate 生成表索引 [英] Generate table indexes using Fluent NHibernate

查看:22
本文介绍了使用 Fluent NHibernate 生成表索引的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用 Fluent NHibernate 生成表索引以及数据库模式的其余部分?我希望能够通过自动构建过程生成完整的数据库 DDL.

Is it possible to generate table indexes along with the rest of the database schema with Fluent NHibernate? I would like to be able to generate the complete database DDL via an automated build process.

推荐答案

在 Fluent NHibernate 的最新版本中,您可以调用 Index() 方法来执行此操作,而不是使用 SetAttribute(不再存在):

In more recent versions of Fluent NHibernate, you can call the Index() method to do this rather than using SetAttribute (which no longer exists):

Map(x => x.Prop1).Index("idx__Prop1");

这篇关于使用 Fluent NHibernate 生成表索引的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆