diff --git a/Src/Asp.Net/SqlSugar/IntegrationServices/SplitTableService.cs b/Src/Asp.Net/SqlSugar/IntegrationServices/SplitTableService.cs index d55593d16..5269a75ff 100644 --- a/Src/Asp.Net/SqlSugar/IntegrationServices/SplitTableService.cs +++ b/Src/Asp.Net/SqlSugar/IntegrationServices/SplitTableService.cs @@ -35,7 +35,16 @@ namespace SqlSugar } public virtual string GetTableName(ISqlSugarClient db, EntityInfo EntityInfo) { - return GetTableName(db, EntityInfo, SplitType.Day); + var splitTableAttribute = EntityInfo.Type.GetCustomAttribute(); + if (splitTableAttribute != null) + { + var type=(splitTableAttribute as SplitTableAttribute).SplitType; + return GetTableName(db, EntityInfo, type); + } + else + { + return GetTableName(db, EntityInfo, SplitType.Day); + } } public virtual string GetTableName(ISqlSugarClient db, EntityInfo EntityInfo, SplitType splitType) {