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");
|
||||
var isAuto = this.context.CurrentConnectionConfig.IsAutoCloseConnection;
|
||||
this.context.CurrentConnectionConfig.IsAutoCloseConnection = false;
|
||||
var old = this.context.Ado.IsDisableMasterSlaveSeparation;
|
||||
this.context.Ado.IsDisableMasterSlaveSeparation = true;
|
||||
DataTable dt = ToDdateTable(datas);
|
||||
IFastBuilder buider = GetBuider();
|
||||
buider.Context = context;
|
||||
@@ -255,6 +257,7 @@ namespace SqlSugar
|
||||
this.context.CurrentConnectionConfig.IsAutoCloseConnection = isAuto;
|
||||
buider.CloseDb();
|
||||
End(datas, false, true);
|
||||
this.context.Ado.IsDisableMasterSlaveSeparation = old;
|
||||
return result;
|
||||
}
|
||||
catch (Exception)
|
||||
|
@@ -142,11 +142,11 @@ namespace SqlSugar
|
||||
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);
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
@@ -279,6 +279,7 @@ namespace SqlSugar
|
||||
}
|
||||
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.Name2 = ifSingleChildTableColumn_IfListMasterTableColumn;
|
||||
this.NavigatType = navigatType;
|
||||
|
Reference in New Issue
Block a user