You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

49 lines
1.8 KiB

using System.Linq.Expressions;
namespace SqlSugar
{
public class MemberNoExpressionResolve : BaseResolve
{
public MemberNoExpressionResolve(ExpressionParameter parameter) : base(parameter)
{
var expression = base.Expression as MemberExpression;
var isLeft = parameter.IsLeft;
object value = null;
var isField = expression.Member is System.Reflection.FieldInfo;
var isProperty = expression.Member is System.Reflection.PropertyInfo;
var baseParameter = parameter.BaseParameter;
var isSetTempData = baseParameter.CommonTempData.HasValue() && baseParameter.CommonTempData.Equals(CommonTempDataType.Result);
if (isField)
{
value = ExpressionTool.GetFiledValue(expression);
}
else if (isProperty)
{
value = ExpressionTool.GetPropertyValue(expression);
}
switch (base.Context.ResolveType)
{
case ResolveExpressType.WhereSingle:
case ResolveExpressType.WhereMultiple:
case ResolveExpressType.SelectSingle:
case ResolveExpressType.SelectMultiple:
case ResolveExpressType.Update:
if (isSetTempData)
{
baseParameter.CommonTempData = value;
}
else
{
AppendValue(parameter, isLeft, value);
}
break;
case ResolveExpressType.FieldSingle:
break;
case ResolveExpressType.FieldMultiple:
break;
default:
break;
}
}
}
}