Hi,
Im using the AutoPersistenceModel in Fluent NHIbernate to map all my entities and that all works fine :D
However, several of my objects have
public virtual IList<Comment> Comments { get; set; }
In the database there is a single comments table, and each entity with the above code, has its own link table to comments.
At the moment what im doing is:
public class ContractMappingOverride : IAutoMappingOverride<Contract>
{
public void Override(AutoMap<Contract> mapping)
{
mapping.HasManyToMany(x => x.Comments)
.WithTableName("Comment_Contract");
for every entity.
Is there some way i can set a convention where by all mappings to IList<Comment> are wired up automatically as manytomany with the above table name convention?
Thanks
Andrew