mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-23 12:33:44 +08:00
Update UtilMethod
This commit is contained in:
@@ -19,7 +19,15 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
internal static void EndCustomSplitTable(ISqlSugarClient context,Type entityType)
|
internal static void EndCustomSplitTable(ISqlSugarClient context,Type entityType)
|
||||||
{
|
{
|
||||||
|
if (context == null || entityType == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
var splitTableAttribute = entityType.GetCustomAttribute<SplitTableAttribute>();
|
var splitTableAttribute = entityType.GetCustomAttribute<SplitTableAttribute>();
|
||||||
|
if (splitTableAttribute == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (splitTableAttribute.CustomSplitTableService != null)
|
if (splitTableAttribute.CustomSplitTableService != null)
|
||||||
{
|
{
|
||||||
context.CurrentConnectionConfig.ConfigureExternalServices.SplitTableService = null;
|
context.CurrentConnectionConfig.ConfigureExternalServices.SplitTableService = null;
|
||||||
@@ -28,6 +36,15 @@ namespace SqlSugar
|
|||||||
|
|
||||||
internal static void StartCustomSplitTable(ISqlSugarClient context, Type entityType)
|
internal static void StartCustomSplitTable(ISqlSugarClient context, Type entityType)
|
||||||
{
|
{
|
||||||
|
if (context == null || entityType == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var splitTableAttribute = entityType.GetCustomAttribute<SplitTableAttribute>();
|
||||||
|
if (splitTableAttribute == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
var splitTableAttribute = entityType.GetCustomAttribute<SplitTableAttribute>();
|
var splitTableAttribute = entityType.GetCustomAttribute<SplitTableAttribute>();
|
||||||
if (splitTableAttribute.CustomSplitTableService != null)
|
if (splitTableAttribute.CustomSplitTableService != null)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user