TAG: nhibernate

Software Engineer, somewhere between irritated and annoyed.

Self Referencing Table Joins in FluentNHibernate

A common usage of the self-referencing joins is the use of 1 table for regions and subregions; its also the laziest example that comes to mind. Entity using System.Collections.Generic; using Domain.Base; public class Region : DomainObject<int, Region> { private IList<Region> _subRegion = new List<Region>(); public virtual string Name { get; set; } public virtual IList<Region> SubRegion { get { return _subRegion; } set { _subRegion = value; } } } ClassMap using Domain; using…