Generate table indexes using Fluent NHibernate

fluent-nhibernatenhibernatenhibernate-mapping

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.

Best Answer

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");