Support Discrimator

This commit is contained in:
sunkaixuan 2023-07-18 20:31:21 +08:00
parent 615d31a311
commit 54cf0c8b38

View File

@ -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))