From a537cc89218311250809883c2ad827782318a451 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20R=C3=BCberg?= Date: Sun, 18 Oct 2015 21:44:43 +0200 Subject: [PATCH] Respect existing table name When a table name is allready set it shouldn't just be overriden. --- src/FluentNHibernate/Visitors/ManyToManyTableNameVisitor.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/FluentNHibernate/Visitors/ManyToManyTableNameVisitor.cs b/src/FluentNHibernate/Visitors/ManyToManyTableNameVisitor.cs index a7dac1a7a..ed9e75e89 100644 --- a/src/FluentNHibernate/Visitors/ManyToManyTableNameVisitor.cs +++ b/src/FluentNHibernate/Visitors/ManyToManyTableNameVisitor.cs @@ -13,7 +13,7 @@ public override void ProcessCollection(CollectionMapping mapping) if (mapping.OtherSide == null) { // uni-directional - mapping.Set(x => x.TableName, Layer.Defaults, mapping.ChildType.Name + "To" + mapping.ContainingEntityType.Name); + mapping.Set(x => x.TableName, Layer.Defaults, mapping.TableName ?? mapping.ChildType.Name + "To" + mapping.ContainingEntityType.Name); } else { @@ -25,4 +25,4 @@ public override void ProcessCollection(CollectionMapping mapping) } } } -} \ No newline at end of file +}