mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-11-08 02:14:53 +08:00
Split table
This commit is contained in:
@@ -34,9 +34,18 @@ namespace SqlSugar
|
||||
return result;
|
||||
}
|
||||
public virtual string GetTableName(ISqlSugarClient db, EntityInfo EntityInfo)
|
||||
{
|
||||
var splitTableAttribute = EntityInfo.Type.GetCustomAttribute<SplitTableAttribute>();
|
||||
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)
|
||||
{
|
||||
var date = db.GetDate();
|
||||
|
||||
Reference in New Issue
Block a user