2010-06-29 46 views
0

此代碼無法編譯時出現錯誤'NHibernate.Mapping.Property'不是屬性類。任何想法爲什麼?'NHibernate.Mapping.Property'不是屬性類

using System; 
using System.Linq; 
using DevExpress.Xpo; 
using System.Collections.Generic; 
using System.Text; 
using NHibernate.Mapping; 

namespace Test { 

    public class User : IdentityItem { 

    public string email; 
    public string password; 
    public string displayname; 

    [NHibernate.Mapping.Property(IsLazy = true, IsOptional = true, Name = "admin_notes")] 
    public string admin_notes { get; set; } 

    } 
} 

在此先感謝:-)

回答

3

這是因爲 'NHibernate.Mapping.Property' 不是屬性類。

改爲使用'NHibernate.Mapping.Attributes.Property'。

+0

或更改/添加使用NHibernate.Mapping.Attributes.Property,只是使用[屬性(IsLaz ... – 2010-06-29 11:02:35

+0

有沒有辦法做到這一點與NH3? – 2010-06-30 16:34:24

+0

我認爲是的,我沒有測試過,但我看到沒有理由爲什麼它不會工作 – 2010-06-30 16:42:14