Duplicate join exception thrown even with tables coming from different schemas/catalogs #244

Open
tenninebt opened this Issue Oct 28, 2013 · 0 comments

Comments

Projects
None yet
1 participant

Here is an example explaining the issue:

When we do the following :

Join("tablename", join =>
{
join.Schema("schema1").Catalog("catalog1");
join.Optional();
join.KeyColumn("somekeycolumn");
});

Join("tablename", join =>
{
join.Schema("schema2").Catalog("catalog2");
join.Optional();
join.KeyColumn("somekeycolumn");
});

Fluent throws an exception :
if (joins.Exists(x => x.TableName == mapping.TableName)
throw new InvalidOperationException("Tried to add join to table '" + mapping.TableName + "' when already added.");

The check should look more like :

if (joins.Exists(x => x.TableName == mapping.TableName && x.Schema == mapping.Schema && x.Catalog == mapping.Catalog))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment