2011-10-15 95 views

回答

1

當然,只是註冊FluentNHibernate convention這樣的:

public class AssignedIdConvention : IIdConvention 
{ 
    public void Apply(IIdentityInstance instance) 
    { 
     instance.GeneratedBy.Assigned(); 
    } 
} 

註冊是這樣的:

Fluently.Configure() 
    .Mappings(...) 
    .Conventions.Add<AssignedIdConvention>()