Quantcast
Channel: EntityFramework Reverse POCO Code First Generator
Viewing all articles
Browse latest Browse all 1642

Commented Issue: Bridge tables schema issue [98]

$
0
0
I have found a bug in EF.Reverse.POCO.Core.ttinclude line 2326 : if prependSchemaName variable is false, the many-to-many configuration method is generated without the schema parameter. It should do the opposite

```
public void AddMappingConfiguration(ForeignKey left, ForeignKey right, bool useCamelCase, bool prependSchemaName, string leftPropName, string rightPropName)
{
MappingConfiguration.Add(string.Format(@"HasMany(t => t.{0}).WithMany(t => t.{1}).Map(m =>
{{
m.ToTable(""{2}""{5});
m.MapLeftKey(""{3}"");
m.MapRightKey(""{4}"");
}});", leftPropName, rightPropName, left.FkTableName, left.FkColumn, right.FkColumn, prependSchemaName ? ", schema" : ""));
}
```

The code should be:
```
public void AddMappingConfiguration(ForeignKey left, ForeignKey right, bool useCamelCase, bool prependSchemaName, string leftPropName, string rightPropName)
{
MappingConfiguration.Add(string.Format(@"HasMany(t => t.{0}).WithMany(t => t.{1}).Map(m =>
{{
m.ToTable(""{2}""{5});
m.MapLeftKey(""{3}"");
m.MapRightKey(""{4}"");
}});", leftPropName, rightPropName, left.FkTableName, left.FkColumn, right.FkColumn, !prependSchemaName ? ", schema" : ""));
}
```
Comments: The schema will not be included for SQL Compact, but will for SQL Server, so all should be ok Erik.

Viewing all articles
Browse latest Browse all 1642

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>