I have generate some fluent NHibernate code. It has entity code like:
private ISet<CardPlace> _cardPlace;
public MagazineType()
{
_cardPlace = new HashedSet<CardPlace>();
}
public virtual ISet<CardPlace> CardPlace
{
get { return _cardPlace; }
set { _cardPlace = value; }
}
And mapping for this property like:
HasMany(x => x.CardPlace)
.Access.CamelCaseField(Prefix.Underscore)
.Cascade.AllDeleteOrphan()
.Fetch.Select()
.AsSet()
.Inverse()
.LazyLoad()
.KeyColumns.Add("MAGAZINE_ID");
What I don't understand is the .Access.CamelCaseField(Prefix.Underscore) line. Why is it not being mapped directly to property but instead mapped to the private backing field ? Is there any reason for doing this ?