mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-19 18:22:23 +08:00
Update core
This commit is contained in:
@@ -280,6 +280,8 @@ namespace SqlSugar
|
|||||||
method = isNullableType ? getConvertDateTime : getDateTime;
|
method = isNullableType ? getConvertDateTime : getDateTime;
|
||||||
if (bindProperyTypeName == "datetime" && dbTypeName.ToLower() == "time")
|
if (bindProperyTypeName == "datetime" && dbTypeName.ToLower() == "time")
|
||||||
method = isNullableType ? getConvertTime : getTime;
|
method = isNullableType ? getConvertTime : getTime;
|
||||||
|
if (bindProperyTypeName == "datetimeoffset")
|
||||||
|
method = isNullableType ? getConvertdatetimeoffset : getdatetimeoffset;
|
||||||
break;
|
break;
|
||||||
case CSharpDataType.@decimal:
|
case CSharpDataType.@decimal:
|
||||||
CheckType(bind.DecimalThrow, bindProperyTypeName, validPropertyName, propertyName);
|
CheckType(bind.DecimalThrow, bindProperyTypeName, validPropertyName, propertyName);
|
||||||
|
@@ -217,8 +217,16 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
return default(DateTimeOffset);
|
return default(DateTimeOffset);
|
||||||
}
|
}
|
||||||
var result = (DateTimeOffset)dr.GetValue(i);
|
var date = dr.GetValue(i);
|
||||||
return result;
|
if (date is DateTime)
|
||||||
|
{
|
||||||
|
return UtilMethods.GetDateTimeOffsetByDateTime((DateTime)(date));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var result = (DateTimeOffset)date;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static DateTimeOffset? GetConvertdatetimeoffset(this IDataRecord dr, int i)
|
public static DateTimeOffset? GetConvertdatetimeoffset(this IDataRecord dr, int i)
|
||||||
@@ -227,8 +235,16 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
return default(DateTimeOffset);
|
return default(DateTimeOffset);
|
||||||
}
|
}
|
||||||
var result = (DateTimeOffset)dr.GetValue(i);
|
var date = dr.GetValue(i);
|
||||||
return result;
|
if (date is DateTime)
|
||||||
|
{
|
||||||
|
return UtilMethods.GetDateTimeOffsetByDateTime((DateTime)(date));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var result = (DateTimeOffset)date;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -55,7 +55,7 @@ namespace SqlSugar
|
|||||||
for (int i = 0; i < st.FrameCount; i++)
|
for (int i = 0; i < st.FrameCount; i++)
|
||||||
{
|
{
|
||||||
var frame = st.GetFrame(i);
|
var frame = st.GetFrame(i);
|
||||||
if (frame.GetMethod().Module.Name.ToLower() != "sqlsugar.dll"&& frame.GetMethod().Name.First()!='<')
|
if (frame.GetMethod().Module.Name.ToLower() != "sqlsugar.dll" && frame.GetMethod().Name.First() != '<')
|
||||||
{
|
{
|
||||||
info.MyStackTraceList.Add(new StackTraceInfoItem()
|
info.MyStackTraceList.Add(new StackTraceInfoItem()
|
||||||
{
|
{
|
||||||
@@ -93,8 +93,8 @@ namespace SqlSugar
|
|||||||
itemSql = Regex.Replace(itemSql, string.Format(@"{0}\,", "\\" + itemParameter.ParameterName), newName + ",", RegexOptions.IgnoreCase);
|
itemSql = Regex.Replace(itemSql, string.Format(@"{0}\,", "\\" + itemParameter.ParameterName), newName + ",", RegexOptions.IgnoreCase);
|
||||||
itemSql = Regex.Replace(itemSql, string.Format(@"{0}$", "\\" + itemParameter.ParameterName), newName, RegexOptions.IgnoreCase);
|
itemSql = Regex.Replace(itemSql, string.Format(@"{0}$", "\\" + itemParameter.ParameterName), newName, RegexOptions.IgnoreCase);
|
||||||
itemSql = Regex.Replace(itemSql, string.Format(@"\+{0}\+", "\\" + itemParameter.ParameterName), "+" + newName + "+", RegexOptions.IgnoreCase);
|
itemSql = Regex.Replace(itemSql, string.Format(@"\+{0}\+", "\\" + itemParameter.ParameterName), "+" + newName + "+", RegexOptions.IgnoreCase);
|
||||||
itemSql = Regex.Replace(itemSql, string.Format(@"\+{0} ", "\\" + itemParameter.ParameterName), "+" + newName +" ", RegexOptions.IgnoreCase);
|
itemSql = Regex.Replace(itemSql, string.Format(@"\+{0} ", "\\" + itemParameter.ParameterName), "+" + newName + " ", RegexOptions.IgnoreCase);
|
||||||
itemSql = Regex.Replace(itemSql, string.Format(@" {0}\+", "\\" + itemParameter.ParameterName)," "+ newName + "+", RegexOptions.IgnoreCase);
|
itemSql = Regex.Replace(itemSql, string.Format(@" {0}\+", "\\" + itemParameter.ParameterName), " " + newName + "+", RegexOptions.IgnoreCase);
|
||||||
itemSql = Regex.Replace(itemSql, string.Format(@"\|\|{0}\|\|", "\\" + itemParameter.ParameterName), "+" + newName + "+", RegexOptions.IgnoreCase);
|
itemSql = Regex.Replace(itemSql, string.Format(@"\|\|{0}\|\|", "\\" + itemParameter.ParameterName), "+" + newName + "+", RegexOptions.IgnoreCase);
|
||||||
return itemSql;
|
return itemSql;
|
||||||
}
|
}
|
||||||
@@ -154,6 +154,13 @@ namespace SqlSugar
|
|||||||
return (T)Convert.ChangeType(obj, typeof(T));
|
return (T)Convert.ChangeType(obj, typeof(T));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal static DateTimeOffset GetDateTimeOffsetByDateTime(DateTime date)
|
||||||
|
{
|
||||||
|
date = DateTime.SpecifyKind(date, DateTimeKind.Utc);
|
||||||
|
DateTimeOffset utcTime2 = date;
|
||||||
|
return utcTime2;
|
||||||
|
}
|
||||||
|
|
||||||
internal static void RepairReplicationParameters(ref string appendSql, SugarParameter[] parameters, int addIndex, string append = null)
|
internal static void RepairReplicationParameters(ref string appendSql, SugarParameter[] parameters, int addIndex, string append = null)
|
||||||
{
|
{
|
||||||
if (appendSql.HasValue() && parameters.HasValue())
|
if (appendSql.HasValue() && parameters.HasValue())
|
||||||
|
Reference in New Issue
Block a user