diff --git a/Src/Asp.NetCore2/SqlSugar.TDengineCore/Tools/SqlSugarExtensions.cs b/Src/Asp.NetCore2/SqlSugar.TDengineCore/Tools/SqlSugarExtensions.cs index 5860cac78..42fd36ee0 100644 --- a/Src/Asp.NetCore2/SqlSugar.TDengineCore/Tools/SqlSugarExtensions.cs +++ b/Src/Asp.NetCore2/SqlSugar.TDengineCore/Tools/SqlSugarExtensions.cs @@ -1,13 +1,27 @@ using SqlSugar.TDengine; using System; using System.Collections.Generic; +using System.Linq; using System.Reflection; +using System.Runtime.CompilerServices; using System.Text; namespace SqlSugar { public static class SqlSugarExtensions - { + { + public static ISugarQueryable AsTDengineSTable(this ISugarQueryable queryable) where T:class,new() + { + var attr=SqlSugar.TDengine.UtilMethods.GetCommonSTableAttribute(queryable.Context,typeof(T).GetCustomAttribute()); + queryable.AS(attr.STableName); + return queryable; + } + public static IDeleteable AsTDengineSTable(this IDeleteable queryable) where T : class, new() + { + var attr = SqlSugar.TDengine.UtilMethods.GetCommonSTableAttribute(((DeleteableProvider)queryable).Context, typeof(T).GetCustomAttribute()); + queryable.AS(attr.STableName); + return queryable; + } public static void MappingSTableName(this ISqlSugarClient db,string newSTableName) { STableAttribute sTableAttribute = typeof(T).GetCustomAttribute();