2010-05-15 46 views

回答

8

管理解決我自己的解決方案。這裏的代碼:

public class OraclePrimaryKeySequenceConvention : IIdConvention 
{ 
    public void Apply(IIdentityInstance instance) 
    { 
     instance.GeneratedBy.Sequence(string.Format("Sequence_{0}", 
                instance.EntityType.Name)); 
    } 
} 

耶。 :-)

+0

過了一段時間,但我會如何使用它? – ConsultUtah 2011-01-26 18:19:02

+1

@consultutah添加爲約定 - > http://wiki.fluentnhibernate.org/Conventions – rebelliard 2011-01-26 23:10:20

+0

完美!謝謝 – ConsultUtah 2011-01-27 18:10:54