mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-07-30 22:10:22 +08:00
Update core
This commit is contained in:
parent
e9bf020ab0
commit
3e234aa52f
@ -13,6 +13,21 @@ namespace SqlSugar
|
||||
var expression = base.Expression as ConstantExpression;
|
||||
var isLeft = parameter.IsLeft;
|
||||
object value = ExpressionTool.GetValue(expression.Value,this.Context);
|
||||
if (this.Context.TableEnumIsString == true
|
||||
&& value != null
|
||||
&& value.IsInt()
|
||||
&& base.BaseParameter?.OppsiteExpression != null)
|
||||
{
|
||||
if (base.BaseParameter?.OppsiteExpression is UnaryExpression)
|
||||
{
|
||||
var oppsiteExpression = base.BaseParameter?.OppsiteExpression as UnaryExpression;
|
||||
var oppsiteValue = oppsiteExpression.Operand;
|
||||
if (oppsiteValue.Type.IsEnum())
|
||||
{
|
||||
value = UtilMethods.ChangeType2(value, oppsiteValue.Type).ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
var baseParameter = parameter.BaseParameter;
|
||||
baseParameter.ChildExpression = expression;
|
||||
var isSetTempData = baseParameter.CommonTempData.HasValue() && baseParameter.CommonTempData.Equals(CommonTempDataType.Result);
|
||||
|
@ -678,6 +678,24 @@ namespace SqlSugar
|
||||
model.Args[0].MemberValue = first.Value;
|
||||
}
|
||||
}
|
||||
if (this.Context.TableEnumIsString == true)
|
||||
{
|
||||
List<string> enumStringList = new List<string>();
|
||||
foreach (var inItem in (model.Args[0].MemberValue as IEnumerable))
|
||||
{
|
||||
if (inItem != null)
|
||||
{
|
||||
if (UtilMethods.GetUnderType(inItem.GetType()).IsEnum())
|
||||
{
|
||||
enumStringList.Add(inItem.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
if (enumStringList.Any())
|
||||
{
|
||||
model.Args[0].MemberValue = enumStringList;
|
||||
}
|
||||
}
|
||||
var caResult = this.Context.DbMehtods.ContainsArray(model);
|
||||
this.Context.Parameters.RemoveAll(it => it.ParameterName == model.Args[0].MemberName.ObjToString());
|
||||
return caResult;
|
||||
|
Loading…
Reference in New Issue
Block a user