Change query condition from name to alias

This commit is contained in:
Per Ploug
2017-01-05 08:45:04 +01:00
parent 051801f337
commit 8b479b57e5

View File

@@ -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);
}
}