2

帐户实体具有应为组件的条款组件。

Account.cs 
public Guid Id {get; set;}
public Terms Terms {get; set;}
...

Terms.cs
public string TermsText {get;set;}
public DateTime Created {get; set;}

现在我尝试根据这个例子进行映射(通过代码)

AccountMap.cs
...
Component(p => p.Terms, TermsMap.Mapping());

TermsMap.cs
public class TermsMap
{
    public static Action<IComponentMapper<Terms>> Mapping()
    {
        return c =>
        {
            c.Property(p => p.TermsText);
            c.Property(p => p.Created);
        };
    }
}

NhibernateMappingException:无法确定条款的类型

我在这里做错了什么?

谢谢

4

0 回答 0