Skip to content

Commit ea161ff

Browse files
authored
Merge pull request #4 from dotnet/master
Update fork
2 parents 3fb99ae + 3780923 commit ea161ff

File tree

6 files changed

+276
-84
lines changed

6 files changed

+276
-84
lines changed

src/Microsoft.ML.Api/SchemaDefinition.cs

+3-2
Original file line numberDiff line numberDiff line change
@@ -332,8 +332,9 @@ public static SchemaDefinition Create(Type userType)
332332

333333
if (fieldInfo.GetCustomAttribute<NoColumnAttribute>() != null)
334334
continue;
335-
var mappingAttr = fieldInfo.GetCustomAttribute<ColumnNameAttribute>();
336-
var name = mappingAttr == null ? fieldInfo.Name : (mappingAttr.Name ?? fieldInfo.Name);
335+
var mappingAttr = fieldInfo.GetCustomAttribute<ColumnAttribute>();
336+
var mappingNameAttr = fieldInfo.GetCustomAttribute<ColumnNameAttribute>();
337+
string name = mappingAttr?.Name ?? mappingNameAttr?.Name ?? fieldInfo.Name;
337338
// Disallow duplicate names, because the field enumeration order is not actually
338339
// well defined, so we are not gauranteed to have consistent "hiding" from run to
339340
// run, across different .NET versions.

0 commit comments

Comments
 (0)