I have an object model similar to this:
public class Item
{
public virtual Guid Id { get; set; }
}
public class Box
{
public virtual Guid Id { get; set; }
public virtual IList<Item> Contents { get; protected set; }
public Box()
{
Contents = new List<Item>();
}
}
What I want to do is be able to get an Item's parent (being the box it is in). Normally I would create a field on the Item called Parent and handle the one-to-many relationship in a manual mapping, but we are trying to use automapping on this project. Is there someway I can create either a Box or a BoxId field ID on the Item and have FNH auto-maigially populate for me when object (in this case Box) is saved?
Thanks!