Synchronization code

This commit is contained in:
sunkaixuan
2023-06-11 21:51:48 +08:00
parent 872aac058e
commit b6f5714720
4 changed files with 25 additions and 1 deletions

View File

@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SqlSugar
{
public class ExpressionContextCase
{
public bool IsDateString { get; set; }
}
}

View File

@@ -19,6 +19,7 @@ namespace SqlSugar
#endregion
#region Properties
public virtual ExpressionContextCase Case{ get; set; }
public ExpressionOutParameter SugarContext { get; set; }
public IDbMethods DbMehtods
{

View File

@@ -517,7 +517,14 @@ namespace SqlSugar
var isConst = parameter.CommonTempData.GetType() == UtilConstants.DateType;
if (isConst)
{
AppendValue(parameter, isLeft, parameter.CommonTempData.ObjToDate().Date);
if (this.Context?.Case?.IsDateString==true)
{
AppendMember(parameter, isLeft, GetToDateShort("'" + parameter.CommonTempData.ObjToDate().Date.ToString("yyyy-MM-dd") + "'"));
}
else
{
AppendValue(parameter, isLeft, parameter.CommonTempData.ObjToDate().Date);
}
}
else
{

View File

@@ -4,6 +4,9 @@ namespace SqlSugar
{
public class SqliteExpressionContext : ExpressionContext, ILambdaExpressions
{
public override ExpressionContextCase Case { get; set; } = new ExpressionContextCase() {
IsDateString= true,
};
public SqlSugarProvider Context { get; set; }
public SqliteExpressionContext()
{