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

Commented Unassigned: 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: Will this work well with SQL Compact, that does not have schema names?

Viewing all articles
Browse latest Browse all 1642

Trending Articles



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