From 5eb7ff604a08ae3ecc9ee09d90e1ec361754ac6d Mon Sep 17 00:00:00 2001 From: sunkaixuna <610262374@qq.com> Date: Sun, 31 Oct 2021 09:41:30 +0800 Subject: [PATCH] Code optimization --- .../SqlSugar/IntegrationServices/SplitTableService.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Src/Asp.Net/SqlSugar/IntegrationServices/SplitTableService.cs b/Src/Asp.Net/SqlSugar/IntegrationServices/SplitTableService.cs index 4bff51c0d..d55593d16 100644 --- a/Src/Asp.Net/SqlSugar/IntegrationServices/SplitTableService.cs +++ b/Src/Asp.Net/SqlSugar/IntegrationServices/SplitTableService.cs @@ -11,7 +11,7 @@ namespace SqlSugar public class DateSplitTableService : ISplitTableService { #region Core - public List GetAllTables(ISqlSugarClient db, EntityInfo EntityInfo, List tableInfos) + public virtual List GetAllTables(ISqlSugarClient db, EntityInfo EntityInfo, List tableInfos) { CheckTableName(EntityInfo.DbTableName); var regex = EntityInfo.DbTableName.Replace("{year}", "([0-9]{2,4})").Replace("{day}", "([0-9]{1,2})").Replace("{month}", "([0-9]{1,2})"); @@ -33,21 +33,21 @@ namespace SqlSugar result = result.OrderByDescending(it => it.Date).ToList(); return result; } - public string GetTableName(ISqlSugarClient db, EntityInfo EntityInfo) + public virtual string GetTableName(ISqlSugarClient db, EntityInfo EntityInfo) { return GetTableName(db, EntityInfo, SplitType.Day); } - public string GetTableName(ISqlSugarClient db, EntityInfo EntityInfo, SplitType splitType) + public virtual string GetTableName(ISqlSugarClient db, EntityInfo EntityInfo, SplitType splitType) { var date = db.GetDate(); return GetTableNameByDate(EntityInfo, splitType, date); } - public string GetTableName(ISqlSugarClient db, EntityInfo entityInfo, SplitType splitType, object fieldValue) + public virtual string GetTableName(ISqlSugarClient db, EntityInfo entityInfo, SplitType splitType, object fieldValue) { var value = Convert.ToDateTime(fieldValue); return GetTableNameByDate(entityInfo, splitType, value); } - public object GetFieldValue(ISqlSugarClient db, EntityInfo entityInfo, SplitType splitType, object entityValue) + public virtual object GetFieldValue(ISqlSugarClient db, EntityInfo entityInfo, SplitType splitType, object entityValue) { var splitColumn = entityInfo.Columns.FirstOrDefault(it => it.PropertyInfo.GetCustomAttribute() != null); if (splitColumn == null)