Change query condition from name to alias
This commit is contained in:
@@ -24,6 +24,9 @@
|
||||
|
||||
private static string BuildConditionString(this QueryCondition condition, string prefix, int token = -1)
|
||||
{
|
||||
|
||||
|
||||
|
||||
var operand = string.Empty;
|
||||
var value = string.Empty;
|
||||
var constraintValue = string.Empty;
|
||||
@@ -56,10 +59,10 @@
|
||||
operand = " <= ";
|
||||
break;
|
||||
case Operathor.Contains:
|
||||
value = string.Format("{0}{1}.Contains({2})", prefix, condition.Property.Name, constraintValue);
|
||||
value = string.Format("{0}{1}.Contains({2})", prefix, condition.Property.Alias, constraintValue);
|
||||
break;
|
||||
case Operathor.NotContains:
|
||||
value = string.Format("!{0}{1}.Contains({2})", prefix, condition.Property.Name, constraintValue);
|
||||
value = string.Format("!{0}{1}.Contains({2})", prefix, condition.Property.Alias, constraintValue);
|
||||
break;
|
||||
default :
|
||||
operand = " == ";
|
||||
@@ -69,7 +72,7 @@
|
||||
if (string.IsNullOrEmpty(value) == false)
|
||||
return value;
|
||||
|
||||
return string.Format("{0}{1}{2}{3}", prefix, condition.Property.Name, operand, constraintValue);
|
||||
return string.Format("{0}{1}{2}{3}", prefix, condition.Property.Alias, operand, constraintValue);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user