public string ToSqlQuery(IList <Type> model = null) { string op; switch (this.op) { case Operator.Equals: op = "="; break; case Operator.NotEquals: op = "<>"; break; case Operator.Like: op = "LIKE"; break; default: throw new NotImplementedException("Unknown sql operator " + this.op.ToString()); } return(string.Format("({0} {1} {2})", lhs.ToSqlQuery(model), op, rhs.ToSqlQuery(model))); }