mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-19 18:22:23 +08:00
Synchronization code
This commit is contained in:
@@ -237,6 +237,8 @@ namespace SqlSugar
|
|||||||
Check.Exception(whereColumns == null || whereColumns.Count() == 0, "where columns count=0 or need primary key");
|
Check.Exception(whereColumns == null || whereColumns.Count() == 0, "where columns count=0 or need primary key");
|
||||||
var isAuto = this.context.CurrentConnectionConfig.IsAutoCloseConnection;
|
var isAuto = this.context.CurrentConnectionConfig.IsAutoCloseConnection;
|
||||||
this.context.CurrentConnectionConfig.IsAutoCloseConnection = false;
|
this.context.CurrentConnectionConfig.IsAutoCloseConnection = false;
|
||||||
|
var old = this.context.Ado.IsDisableMasterSlaveSeparation;
|
||||||
|
this.context.Ado.IsDisableMasterSlaveSeparation = true;
|
||||||
DataTable dt = ToDdateTable(datas);
|
DataTable dt = ToDdateTable(datas);
|
||||||
IFastBuilder buider = GetBuider();
|
IFastBuilder buider = GetBuider();
|
||||||
buider.Context = context;
|
buider.Context = context;
|
||||||
@@ -255,6 +257,7 @@ namespace SqlSugar
|
|||||||
this.context.CurrentConnectionConfig.IsAutoCloseConnection = isAuto;
|
this.context.CurrentConnectionConfig.IsAutoCloseConnection = isAuto;
|
||||||
buider.CloseDb();
|
buider.CloseDb();
|
||||||
End(datas, false, true);
|
End(datas, false, true);
|
||||||
|
this.context.Ado.IsDisableMasterSlaveSeparation = old;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
|
@@ -142,11 +142,11 @@ namespace SqlSugar
|
|||||||
value = UtilMethods.ConvertFromDateTimeOffset((DateTimeOffset)value);
|
value = UtilMethods.ConvertFromDateTimeOffset((DateTimeOffset)value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (value != null && column.UnderType?.FullName == "System.TimeOnly")
|
else if (value != DBNull.Value&&value != null && column.UnderType?.FullName == "System.TimeOnly")
|
||||||
{
|
{
|
||||||
value = UtilMethods.TimeOnlyToTimeSpan(value);
|
value = UtilMethods.TimeOnlyToTimeSpan(value);
|
||||||
}
|
}
|
||||||
else if (value != null && column.UnderType?.FullName == "System.DateOnly")
|
else if (value != DBNull.Value && value != null && column.UnderType?.FullName == "System.DateOnly")
|
||||||
{
|
{
|
||||||
value = UtilMethods.DateOnlyToDateTime(value);
|
value = UtilMethods.DateOnlyToDateTime(value);
|
||||||
}
|
}
|
||||||
|
@@ -279,6 +279,7 @@ namespace SqlSugar
|
|||||||
}
|
}
|
||||||
public Navigate(NavigateType navigatType, string ifSingleMasterTableColumn_IfListChildTableColumn, string ifSingleChildTableColumn_IfListMasterTableColumn)
|
public Navigate(NavigateType navigatType, string ifSingleMasterTableColumn_IfListChildTableColumn, string ifSingleChildTableColumn_IfListMasterTableColumn)
|
||||||
{
|
{
|
||||||
|
Check.ExceptionEasy(navigatType == NavigateType.ManyToMany, "Correct usage [Navigate(typeof(ABMapping), nameof(abmapping.aid), nameof(abmapp.bid))], incorrect usage: [Navigate(Navigate.ManyToMany, nameof(ABMapping.Aid), nameof(ABMapping.BId))]", "多对多第一个参数是Type不是NavigateType,正确用法[Navigate(typeof(ABMapping), nameof(ABMapping.Aid), nameof(ABMapping.BId))],错误用法:[Navigate(Navigate.ManyToMany, nameof(ABMapping.Aid), nameof(ABMapping.BId))]");
|
||||||
this.Name = ifSingleMasterTableColumn_IfListChildTableColumn;
|
this.Name = ifSingleMasterTableColumn_IfListChildTableColumn;
|
||||||
this.Name2 = ifSingleChildTableColumn_IfListMasterTableColumn;
|
this.Name2 = ifSingleChildTableColumn_IfListMasterTableColumn;
|
||||||
this.NavigatType = navigatType;
|
this.NavigatType = navigatType;
|
||||||
|
Reference in New Issue
Block a user