mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-05-04 04:37:58 +08:00
Synchronization code
This commit is contained in:
parent
1759bd4c3e
commit
ca7ea939cb
@ -42,7 +42,7 @@ namespace SqlSugar
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var type = value.GetType();
|
var type = UtilMethods.GetUnderType(value.GetType());
|
||||||
if (type == UtilConstants.DateType)
|
if (type == UtilConstants.DateType)
|
||||||
{
|
{
|
||||||
var date = value.ObjToDate();
|
var date = value.ObjToDate();
|
||||||
@ -52,6 +52,10 @@ namespace SqlSugar
|
|||||||
}
|
}
|
||||||
return "'" + date.ToString("yyyy-MM-dd HH:mm:ss.fff") + "'";
|
return "'" + date.ToString("yyyy-MM-dd HH:mm:ss.fff") + "'";
|
||||||
}
|
}
|
||||||
|
else if (type == UtilConstants.DateTimeOffsetType)
|
||||||
|
{
|
||||||
|
return FormatDateTimeOffset(value);
|
||||||
|
}
|
||||||
else if (type == UtilConstants.ByteArrayType)
|
else if (type == UtilConstants.ByteArrayType)
|
||||||
{
|
{
|
||||||
string bytesString = "0x" + BitConverter.ToString((byte[])value);
|
string bytesString = "0x" + BitConverter.ToString((byte[])value);
|
||||||
@ -217,5 +221,9 @@ namespace SqlSugar
|
|||||||
columnsString = columnsString.Replace(Builder.GetTranslationColumnName(this.ShortName) + ".", "") + joinString;
|
columnsString = columnsString.Replace(Builder.GetTranslationColumnName(this.ShortName) + ".", "") + joinString;
|
||||||
return string.Format(SqlTemplate, tableName, columnsString, whereString);
|
return string.Format(SqlTemplate, tableName, columnsString, whereString);
|
||||||
}
|
}
|
||||||
|
public override string FormatDateTimeOffset(object value)
|
||||||
|
{
|
||||||
|
return "'" + ((DateTimeOffset)value).ToString("o") + "'";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,7 @@ namespace SqlSugar
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var type = value.GetType();
|
var type =UtilMethods.GetUnderType(value.GetType());
|
||||||
if (type == UtilConstants.DateType||columnInfo.IsArray||columnInfo.IsJson)
|
if (type == UtilConstants.DateType||columnInfo.IsArray||columnInfo.IsJson)
|
||||||
{
|
{
|
||||||
var parameterName = this.Builder.SqlParameterKeyWord + name + i;
|
var parameterName = this.Builder.SqlParameterKeyWord + name + i;
|
||||||
@ -58,6 +58,10 @@ namespace SqlSugar
|
|||||||
this.Parameters.Add(paramter);
|
this.Parameters.Add(paramter);
|
||||||
return parameterName;
|
return parameterName;
|
||||||
}
|
}
|
||||||
|
else if (type == UtilConstants.DateTimeOffsetType)
|
||||||
|
{
|
||||||
|
return FormatDateTimeOffset(value);
|
||||||
|
}
|
||||||
else if (type == UtilConstants.ByteArrayType)
|
else if (type == UtilConstants.ByteArrayType)
|
||||||
{
|
{
|
||||||
string bytesString = "0x" + BitConverter.ToString((byte[])value);
|
string bytesString = "0x" + BitConverter.ToString((byte[])value);
|
||||||
@ -237,5 +241,9 @@ namespace SqlSugar
|
|||||||
columnsString = columnsString.Replace(Builder.GetTranslationColumnName(this.ShortName)+".","")+joinString;
|
columnsString = columnsString.Replace(Builder.GetTranslationColumnName(this.ShortName)+".","")+joinString;
|
||||||
return string.Format(SqlTemplate, tableName, columnsString, whereString);
|
return string.Format(SqlTemplate, tableName, columnsString, whereString);
|
||||||
}
|
}
|
||||||
|
public override string FormatDateTimeOffset(object value)
|
||||||
|
{
|
||||||
|
return "'" + ((DateTimeOffset)value).ToString("o") + "'";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user