2

我有一个代表位置的对象。位置可以包含其他位置。我如何用 Fluent NHibernate 表示这种关系。该类如下所示:

public class Location : EntityBase
{
    #region Properties
    public string LocationName { get; set; }
    public Location ParentLocation { get; private set; }

    private List<Location> _locations = new List<Location>();
    public IEnumerable<Location> Locations
    {
        get { return _locations; }
    }

    private List<Device> _devices = new List<Device>();
    public IEnumerable<Device> Devices
    {
        get { return _devices; }
    }

    #endregion
    //Other logic omitted
}

谢谢。

4

1 回答 1

0

有可能获得私有领域

HasManyToMany(Member.Reveal<Location>("_locations"))
于 2011-05-19T11:02:20.093 回答