1
public class AdminUser
{
public virtual int Id { get; set; }
public virtual string UserName { get; set; }
public virtual string Password { get; set; }
public virtual bool IsLocked { get; set; }
public virtual AdminUser Creator { get; set; }
public virtual DateTime CreationDate { get; set; }
}
public class AdminUserMapping : ClassMap<AdminUser>
{
public AdminUserMapping()
{
Id(c => c.Id).GeneratedBy.Native();
Map(c => c.UserName).Not.Nullable();
Map(c => c.Password).Not.Nullable();
Map(c => c.IsLocked).Not.Nullable();
Map(c => c.CreationDate).Not.Nullable();
//HasOne<AdminUser>(... ?)
}
}
嗨,我有類像上面,我想創建一個一對一的映射對同一類流利的NHibernate:如何創建循環的一對一映射?
我怎麼能做到這一點「造物主」屬性?
其實這是一對多的,而不是一對一的。 – hazzik