I'm trying to figure out how to structure my entity mappings to achieve the following:
public class Document
{
public virtual string Name { get; set; }
// Other properties
public IList<Document> RelatedDocuments { get; set; }
}
I'd like to have a relationship table that has ID pairs of the related Document
s.
Right now I'm addressing this problem with the solution described in this SO question: Fluent Nhibernate mapping related items (crazy coincidence that the OP's name is the same as mine).
I'd rather have a single list of related items and not have to have one for RelatedTo
and one for RelatedFrom
. Is that possible?
To clarify, the problem I'm looking to solve is that if I relate Document A to Document B, I need Document A's
RelatedDocuments
list to have Document B in it, and Document B's RelatedDocuments
list to have Document A in it, without having to create two relationships.