I use AutoPersistenceModel in Fluent NHIbernate to display all my objects and that everything works fine: D
However, some of my objects have
public virtual IList<Comment> Comments { get; set; }
There is one comment table in the database, and each object with the above code has its own comment link table.
At the moment, what I'm doing:
public class ContractMappingOverride : IAutoMappingOverride<Contract> { public void Override(AutoMap<Contract> mapping) { mapping.HasManyToMany(x => x.Comments) .WithTableName("Comment_Contract");
for every entity.
Is there a way I can establish an agreement where all mappings with IList <Comment> are automatically connected as many of them have the above table name convention?
thanks
Andrew
fluent-nhibernate
Andrew Bullock
source share