From 54cf0c8b38107bbb16fdc49e7ee299eff3483990 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Tue, 18 Jul 2023 20:31:21 +0800 Subject: [PATCH] Support Discrimator --- .../SqlSugar/Abstract/CodeFirstProvider/CodeFirstProvider.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Src/Asp.Net/SqlSugar/Abstract/CodeFirstProvider/CodeFirstProvider.cs b/Src/Asp.Net/SqlSugar/Abstract/CodeFirstProvider/CodeFirstProvider.cs index 567d43226..986d0fcfc 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/CodeFirstProvider/CodeFirstProvider.cs +++ b/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))