A fix for MySQL

Feb 20, 2014 at 5:25 PM
I have some problems with the "Include Foreign Keys" option.

When I check this option in some tables there is a null exception because the FK haven't a Foreign Table correctly mapped. I fixed it changing the line 281 of CodeGenerator.cs in the CreateAutoProperties method:

Changing:
foreach (var fk in Table.Columns.Where(c => c.IsForeignKey && !c.IsPrimaryKey))

By:
foreach (var fk in Table.Columns.Where(c => c.IsForeignKey && !c.IsPrimaryKey && !string.IsNullOrEmpty(c.ForeignKeyTableName)))

Kind regards