I've seen answers for unique keys, primary keys... but nothing for a plain old composite (not unique) index definition using Fluent NHibernate.
I have:
public class ObjectPropertyMapping:ClassMap<ObjectProperty>
{
public ObjectPropertyMapping()
{
Table("ObjectProperties");
Id(x => x.ObjectPropertyID);
References(x => x.Object);
Map(x => x.Name);
Map(x => x.Scale);
Map(x => x.Precision);
Map(x => x.Type);
Map(x => x.Value);
}
}
and I want to make a composite index on Object.ObjectID
and Name
. How do I do that?
I haven't tried this but I would assume you would do something like this:
public ObjectPropertyMapping()
{
References(x => x.Object).Index("IX_OBJECT");
Map(x => x.Name).Index("IX_OBJECT");
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With