I have the following class which I am mapping using Fluent NHibernate's AutoMapper. I do not want the list items publically modifiable so have a public IEnumerable
backed by an IList
which can be populated internally or by NHibernate.
I want NHibernate to map teamMembers
to a column named TeamMembers
. I also want FNH to ignore the TeamMembers
property on this class.
public class Team : Entity
{
protected internal virtual IList<Person> teamMembers { get; set; }
public IEnumerable<Person> TeamMembers { get { return teamMembers;} }
}