当前位置:编程学习 > C#/ASP.NET >>

Fluent NHibernate 表主键为guid无法写入

Fluent NHibernate 表主键为guid无法写入

 public class PrimaryKeyGeneratorConvention : IIdConvention 
    { 
        public bool Accept(IIdentityInstance id) 
        { 
            return true; 
        } 
        public void Apply(IIdentityInstance id) 
        { 
            id.GeneratedBy.GuidComb(); 
        } 
    } 


如何解决?

--------------------编程问答-------------------- --------------------编程问答-------------------- 这样设置:<generator class="uuid.hex" /> --------------------编程问答--------------------
引用 2 楼 wuxhyou 的回复:
这样设置:<generator class="uuid.hex" />

刚刚弄好 --------------------编程问答--------------------
补充:.NET技术 ,  ASP.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,