Skip to content

Commit

Permalink
[upd] Automatically ignore columns with unknown types
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergiy Korzh committed May 23, 2022
1 parent 9fccfdc commit 5df4d15
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,10 @@ private bool ApplyMetaEntityAttrAnnotation(MetaEntityAttr entityAttr, PropertyIn
/// <returns>MetaEntityAttr.</returns>
protected virtual MetaEntityAttr CreateEntityAttribute(MetaEntity entity, IEntityType entityType, IProperty property)
{
var columnType = DataUtils.GetDataTypeBySystemType(property.ClrType);

if (columnType == DataType.Unknown) return null;

var propertyName = property.Name;
var columnName = property.GetDbColumnName();

Expand All @@ -410,7 +414,7 @@ protected virtual MetaEntityAttr CreateEntityAttribute(MetaEntity entity, IEntit
entityAttr.Id = DataUtils.ComposeKey(entity.Id, propertyName);
entityAttr.Expr = columnName;
entityAttr.Caption = propertyName;
entityAttr.DataType = DataUtils.GetDataTypeBySystemType(property.ClrType);
entityAttr.DataType = columnType;

entityAttr.PropInfo = property.PropertyInfo;
entityAttr.PropName = property.Name;
Expand Down

0 comments on commit 5df4d15

Please sign in to comment.