0

I'm using Fluent nHibernate AutoMapping for a project and would like to change the initial Id value for one table in my schema from 1 to say 1000 (all other tables I would like to remain with the default behaviour of starting the Id at 1).

I'm guessing that I need to specify this in my IIDConvetion, but am not sure how?

public class PrimaryKeyConvention : IIdConvention
{
    public void Apply(IIdentityInstance instance)
    {
        instance.Column(instance.EntityType.Name + "Id");
        instance.GeneratedBy.Native();
    }
}

Would really appreciate being pointed in the right direction.

mbliss
  • 11
  • 1

1 Answers1

0

AFAIK this is not supported yet. Your best bet is to implement IAuxiliaryDatabaseObject and set the starting value of the identity to 1000 with sql then add it as last element to the configuration object.

Firo
  • 30,626
  • 4
  • 55
  • 94