diff --git a/Src/Asp.Net/SqlSugar/Abstract/CodeFirstProvider/CodeFirstProvider.cs b/Src/Asp.Net/SqlSugar/Abstract/CodeFirstProvider/CodeFirstProvider.cs index c40c312c9..dd48e8cd6 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/CodeFirstProvider/CodeFirstProvider.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/CodeFirstProvider/CodeFirstProvider.cs @@ -106,10 +106,6 @@ namespace SqlSugar protected virtual void Execute(Type entityType) { var entityInfo = this.Context.EntityMaintenance.GetEntityInfo(entityType); - if (entityInfo.IsDisabledUpdateAll) - { - return; - } if (this.DefultLength > 0) { foreach (var item in entityInfo.Columns) @@ -125,6 +121,10 @@ namespace SqlSugar entityInfo.DbTableName = tableName; entityInfo.Columns.ForEach(it => { it.DbTableName = tableName; }); var isAny = this.Context.DbMaintenance.IsAnyTable(tableName); + if (isAny&&entityInfo.IsDisabledUpdateAll) + { + return; + } if (isAny) ExistLogic(entityInfo); else