Browse Source

Support Discrimator

pull/40/head
sunkaixuan 1 year ago
parent
commit
54cf0c8b38
  1. 2
      Src/Asp.Net/SqlSugar/Abstract/CodeFirstProvider/CodeFirstProvider.cs

2
Src/Asp.Net/SqlSugar/Abstract/CodeFirstProvider/CodeFirstProvider.cs

@ -235,7 +235,7 @@ namespace SqlSugar
{
var name = disItem.Split(':').First();
var value = disItem.Split(':').Last();
entityInfo.Columns.Add(new EntityColumnInfo() { IsOnlyIgnoreUpdate = true, DbColumnName = name, UnderType = typeof(string), PropertyName = name, Length = 50 });
entityInfo.Columns.Add(new EntityColumnInfo() { PropertyInfo=typeof(DiscriminatorObject).GetProperty(nameof(DiscriminatorObject.FieldName)),IsOnlyIgnoreUpdate = true, DbColumnName = name, UnderType = typeof(string), PropertyName = name, Length = 50 });
}
}
if (this.MappingTables.ContainsKey(entityType))

Loading…
Cancel
Save