Skip to content

Commit 5bc4626

Browse files
committed
Read in the extended properties before the call to UpdateColumn. Thanks to Elistia.
1 parent e13865c commit 5bc4626

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

EntityFramework.Reverse.POCO.Generator/EF.Reverse.POCO.Core.ttinclude

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2232,7 +2232,7 @@ SELECT SERVERPROPERTY('Edition') AS Edition,
22322232
}
22332233
}
22342234

2235-
var col = CreateColumn(rdr, rxClean, table, usePascalCase, columnFilterExclude, updateColumn);
2235+
var col = CreateColumn(rdr, rxClean, table, usePascalCase, columnFilterExclude);
22362236
if(col != null)
22372237
table.Columns.Add(col);
22382238
}
@@ -2257,6 +2257,8 @@ SELECT SERVERPROPERTY('Edition') AS Edition,
22572257
foreach(Table tbl in result)
22582258
{
22592259
tbl.SetPrimaryKeys();
2260+
foreach (Column c in tbl.Columns)
2261+
updateColumn(c, tbl);
22602262
tbl.Columns.ForEach(x => x.SetupEntityAndConfig(includeComments, includeExtendedPropertyComments, usePrivateSetterForComputedColumns, dataAnnotations, dataAnnotationsSchema, isSqlCe, columnNameToDataAnnotation));
22612263
}
22622264

@@ -2799,7 +2801,7 @@ SELECT SERVERPROPERTY('Edition') AS Edition,
27992801
}
28002802
}
28012803

2802-
private static Column CreateColumn(IDataRecord rdr, Regex rxClean, Table table, bool usePascalCase, Regex columnFilterExclude, Func<Column, Table, Column> updateColumn)
2804+
private static Column CreateColumn(IDataRecord rdr, Regex rxClean, Table table, bool usePascalCase, Regex columnFilterExclude)
28032805
{
28042806
if(rdr == null)
28052807
throw new ArgumentNullException("rdr");
@@ -2874,8 +2876,6 @@ SELECT SERVERPROPERTY('Edition') AS Edition,
28742876

28752877
table.HasNullableColumns = IsNullable(col);
28762878

2877-
col = updateColumn(col, table);
2878-
28792879
// If PropertyType is empty, return null. Most likely ignoring a column due to legacy (such as OData not supporting spatial types)
28802880
if (col != null && string.IsNullOrEmpty(col.PropertyType))
28812881
return null;

0 commit comments

Comments
 (0)