public static MvcHtmlString ToHtmlString(ComparisonPredicate expression, bool link = true) { var comparator = ""; if (expression.Criteria == ComparisonCriteria.Equals) comparator = "="; if (expression.Criteria == ComparisonCriteria.BiggerThan) comparator = ">"; if (expression.Criteria == ComparisonCriteria.BiggerThanOrEquals) comparator = "≥"; if (expression.Criteria == ComparisonCriteria.LessThan) comparator = "<"; if (expression.Criteria == ComparisonCriteria.LessThanOrEquals) comparator = "≤"; if (expression.Criteria == ComparisonCriteria.NotEquals) comparator = "≠"; return MvcHtmlString.Create (string.Format("{0} {1} {2}", Embed(expression, expression.Left, expression.Left.ToHtmlString(link)), comparator, Embed(expression, expression.Right, expression.Right.ToHtmlString(link)) )); }
private static string ToHtmlString(ComparisonPredicate expression) { var comparator = ""; if (expression.Criteria == ComparisonCriteria.Equals) comparator = "="; if (expression.Criteria == ComparisonCriteria.BiggerThan) comparator = ">"; if (expression.Criteria == ComparisonCriteria.BiggerThanOrEquals) comparator = "≥"; if (expression.Criteria == ComparisonCriteria.LessThan) comparator = "<"; if (expression.Criteria == ComparisonCriteria.LessThanOrEquals) comparator = "≤"; if (expression.Criteria == ComparisonCriteria.NotEquals) comparator = "≠"; return string.Format ("{0} {1} {2}", Parenthesize (expression, expression.Left, ToHtmlString (expression.Left)), comparator, Parenthesize (expression, expression.Right, ToHtmlString (expression.Right)) ); }