diff --git a/Src/Asp.NetCore2/SqlSugar.TDengineCore/TDengine/CodeFirst/TDengineCodeFirst.cs b/Src/Asp.NetCore2/SqlSugar.TDengineCore/TDengine/CodeFirst/TDengineCodeFirst.cs index 2bde04594..9d26632a0 100644 --- a/Src/Asp.NetCore2/SqlSugar.TDengineCore/TDengine/CodeFirst/TDengineCodeFirst.cs +++ b/Src/Asp.NetCore2/SqlSugar.TDengineCore/TDengine/CodeFirst/TDengineCodeFirst.cs @@ -12,7 +12,7 @@ namespace SqlSugar.TDengine { protected override void Execute(Type entityType, EntityInfo entityInfo) { - var attr = entityInfo.Type.GetCustomAttribute(); + var attr =GetCommonSTableAttribute( entityInfo.Type.GetCustomAttribute()); if (attr?.STableName!=null&&attr?.Tag1!=null) { entityInfo.DbTableName = attr.STableName; @@ -98,7 +98,7 @@ namespace SqlSugar.TDengine var tableName = GetTableName(entityInfo); var dbColumns = this.Context.DbMaintenance.GetColumnInfosByTableName(tableName, false); ConvertColumns(dbColumns); - var attr = entityInfo.Type.GetCustomAttribute(); + var attr =GetCommonSTableAttribute( entityInfo.Type.GetCustomAttribute()); var entityColumns = entityInfo.Columns.Where(it => it.IsIgnore == false).ToList(); if (attr != null && attr.Tag1 != null) { @@ -222,7 +222,7 @@ namespace SqlSugar.TDengine var addItem = EntityColumnToDbColumn(entityInfo, entityInfo.DbTableName, item); dbColumns.Add(addItem); } - var attr = entityInfo.Type.GetCustomAttribute(); + var attr =GetCommonSTableAttribute( entityInfo.Type.GetCustomAttribute()); var oldTableName = entityInfo.DbTableName; if (attr != null) { @@ -249,7 +249,11 @@ namespace SqlSugar.TDengine } return result; } - + + private STableAttribute GetCommonSTableAttribute(STableAttribute sTableAttribute) + { + return sTableAttribute; + } public string GetDatabaseTypeName(string typeName) { switch (typeName.ToLower()) diff --git a/Src/Asp.NetCore2/SqlSugar.TDengineCore/TDengine/DbMaintenance/TDengineDbMaintenance.cs b/Src/Asp.NetCore2/SqlSugar.TDengineCore/TDengine/DbMaintenance/TDengineDbMaintenance.cs index 590308b12..b5a90de38 100644 --- a/Src/Asp.NetCore2/SqlSugar.TDengineCore/TDengine/DbMaintenance/TDengineDbMaintenance.cs +++ b/Src/Asp.NetCore2/SqlSugar.TDengineCore/TDengine/DbMaintenance/TDengineDbMaintenance.cs @@ -473,7 +473,7 @@ namespace SqlSugar.TDengine public override void AddDefaultValue(EntityInfo entityInfo) { var talbeName = entityInfo.DbTableName; - var attr = entityInfo.Type.GetCustomAttribute(); + var attr = GetCommonSTableAttribute(entityInfo.Type.GetCustomAttribute()); if (attr?.Tag1 != null) { talbeName = attr.STableName; @@ -493,6 +493,11 @@ namespace SqlSugar.TDengine } } + private STableAttribute GetCommonSTableAttribute(STableAttribute sTableAttribute) + { + return sTableAttribute; + } + public override List GetColumnInfosByTableName(string tableName, bool isCache = true) { diff --git a/Src/Asp.NetCore2/SqlSugar.TDengineCore/TDengine/Insertable/TagInserttable.cs b/Src/Asp.NetCore2/SqlSugar.TDengineCore/TDengine/Insertable/TagInserttable.cs index e6a997efa..80bd67f57 100644 --- a/Src/Asp.NetCore2/SqlSugar.TDengineCore/TDengine/Insertable/TagInserttable.cs +++ b/Src/Asp.NetCore2/SqlSugar.TDengineCore/TDengine/Insertable/TagInserttable.cs @@ -124,5 +124,10 @@ namespace SqlSugar }); return groups; } + private STableAttribute GetCommonSTableAttribute(STableAttribute sTableAttribute) + { + return sTableAttribute; + } + } }