Can Fluent nhibernate's automapper be configured to handle private readonly backing fields?
- by Mark Rogers
I like private readonly backing fields because some objects are mostly read-only after creation, and for collections, which rarely need to be set wholesale (instead using collection methods to modify the collection).
For example:
public class BuildingType : DomainEntity
{
/* rest of class */
public IEnumerable<ActionType> ActionsGranted
{
get { return _actionsGranted; }
}
private readonly IList<ActionType> _actionsGranted = new List<ActionType>();
private readonly Image _buildingTile;
public virtual Image BuildingTile
{
get
{
return _buildingTile;
}
}
}
But as far as I remember fluent-nhibernate's
automapper never had a solution for private readonly backing fields, I'm wondering if that's changed in the last few months.
So here's my question:
How do I configure automapper or create an automapping convention to
map private readonly backing fields?