mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-20 10:38:09 +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,9 +217,17 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
return default(DateTimeOffset);
|
return default(DateTimeOffset);
|
||||||
}
|
}
|
||||||
var result = (DateTimeOffset)dr.GetValue(i);
|
var date = dr.GetValue(i);
|
||||||
|
if (date is DateTime)
|
||||||
|
{
|
||||||
|
return UtilMethods.GetDateTimeOffsetByDateTime((DateTime)(date));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var result = (DateTimeOffset)date;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static DateTimeOffset? GetConvertdatetimeoffset(this IDataRecord dr, int i)
|
public static DateTimeOffset? GetConvertdatetimeoffset(this IDataRecord dr, int i)
|
||||||
{
|
{
|
||||||
@@ -227,9 +235,17 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
return default(DateTimeOffset);
|
return default(DateTimeOffset);
|
||||||
}
|
}
|
||||||
var result = (DateTimeOffset)dr.GetValue(i);
|
var date = dr.GetValue(i);
|
||||||
|
if (date is DateTime)
|
||||||
|
{
|
||||||
|
return UtilMethods.GetDateTimeOffsetByDateTime((DateTime)(date));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var result = (DateTimeOffset)date;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public static string GetConvertString(this IDataRecord dr, int i)
|
public static string GetConvertString(this IDataRecord dr, int i)
|
||||||
|
@@ -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