If I create my entity like this:
public class Comment : EntityWithTypedId<Guid> {
public virtual string Author { get; set; }
public virtual string EmailAddress { get; set; }
public virtual string WebAddress { get; set; }
public virtual string Content { get; set; }
public virtual DateTime DatePosted { get; set; }
public virtual Post Post { get; set; }
public virtual Comment Parent { get; set; }
public virtual IList<Comment> Children { get; set; }
}
fluent assumes this is a many-to-many relationship (which I can
understand). In order to work around this I use an override:
public void Override(AutoMapping<Comment> mapping) {
mapping.References<Comment>(x => x.Parent).Column("ParentFk");
mapping.HasMany<Comment>(x => x.Children).Inverse().KeyColumn
("ParentFk");
}
but I was curious if this can be done at all using conventions. As I
rule I never create many-to-many mappings without an intermediate
mapping class so I would never map manytomany this way. What I would
like is for fluent to map this as many-to-one.
I have tried everything I can think of but I can't make the
conventions do this.
Thanks,
Chris
--
You received this message because you are subscribed to the Google Groups "Fluent NHibernate" group.
To post to this group, send email to fluent-n...@googlegroups.com.
To unsubscribe from this group, send email to fluent-nhibern...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/fluent-nhibernate?hl=en.