3

We are using Fluent NHibernate with automapping for our objects. Something like:

AutoPersistenceModel autoMap =
    AutoMap
    .Assemblies(mappingConfig, assembliesToMap.ToArray())
    .Conventions.AddFromAssemblyOf<BaseEntity>();   

I want to to add some indexes to some properties of my objects

I suspect that it can be done somewhere in the mappingConfig object, but I have no idea how this should be done!

Ideas anyone?

k.c.
  • 1,755
  • 1
  • 29
  • 53

1 Answers1

3

You may need to use overrides to do this:

http://wiki.fluentnhibernate.org/Auto_mapping#Altering_entities

.Override<Shelf>(map =>
{
  map.Map(x => x.SomeProperty)
     .Index("ix_myIndex");
});
Cole W
  • 15,123
  • 6
  • 51
  • 85