Esempio n. 1
0
        protected virtual void OnProcessWhereStringExactMemberNode(ISqlWhereCriteriaBuilder builder, StringExactMemberNode memberNode, int memberIndex)
        {
            builder.AddRaw("(");

            builder.AddMember(memberNode, memberIndex);
            builder.AddOp(new OperatorNode(Operator.Equal()));
            builder.AddValue(new ValueNode(memberNode.Value));
            builder.Flush();

            builder.AddRaw(" and ");

            const string castAsVarbinary = "cast({0} as varbinary(300))";

            builder.AddMember(memberNode, memberIndex, castAsVarbinary);
            builder.AddOp(new OperatorNode(Operator.Equal()));
            builder.AddLastValueAgain(castAsVarbinary);
            builder.Flush();

            builder.AddRaw(")");
        }
 protected virtual void OnProcessWhereImplicitBoolMemberNode(ISqlWhereCriteriaBuilder builder, MemberNode memberNode, int memberIndex)
 {
     builder.AddMember(memberNode, memberIndex);
     builder.AddOp(new OperatorNode(Operator.Equal()));
     builder.AddValue(new ValueNode(true));
 }
 protected virtual void OnProccessWhereStringStartsWithMemberNode(ISqlWhereCriteriaBuilder builder, StringStartsWithMemberNode memberNode, int memberIndex)
 {
     builder.AddMember(memberNode, memberIndex);
     builder.AddOp(new OperatorNode(Operator.Like()));
     builder.AddValue(new ValueNode(string.Concat(memberNode.Value, "%")));
 }
        protected virtual void OnProcessWhereStringExactMemberNode(ISqlWhereCriteriaBuilder builder, StringExactMemberNode memberNode, int memberIndex)
        {
            builder.AddRaw("(");
            
            builder.AddMember(memberNode, memberIndex);
            builder.AddOp(new OperatorNode(Operator.Equal()));
            builder.AddValue(new ValueNode(memberNode.Value));
            builder.Flush();

            builder.AddRaw(" and ");

            const string castAsVarbinary = "cast({0} as varbinary(300))";
            builder.AddMember(memberNode, memberIndex, castAsVarbinary);
            builder.AddOp(new OperatorNode(Operator.Equal()));
            builder.AddLastValueAgain(castAsVarbinary);
            builder.Flush();

            builder.AddRaw(")");
        }
 protected virtual void OnProcessWhereStringContainsMemberNode(ISqlWhereCriteriaBuilder builder, StringContainsMemberNode memberNode, int memberIndex)
 {
     builder.AddMember(memberNode, memberIndex);
     builder.AddOp(new OperatorNode(Operator.Like()));
     builder.AddValue(new ValueNode(string.Concat("%", memberNode.Value, "%").Replace("%%", "%")));
 }
 protected virtual void OnProcessWhereLikeMemberNode(ISqlWhereCriteriaBuilder builder, LikeMemberNode memberNode, int memberIndex)
 {
     builder.AddMember(memberNode, memberIndex);
     builder.AddOp(new OperatorNode(Operator.Like()));
     builder.AddValue(new ValueNode(memberNode.Value));
 }
Esempio n. 7
0
 protected virtual void OnProcessWhereImplicitBoolMemberNode(ISqlWhereCriteriaBuilder builder, MemberNode memberNode, int memberIndex)
 {
     builder.AddMember(memberNode, memberIndex);
     builder.AddOp(new OperatorNode(Operator.Equal()));
     builder.AddValue(new ValueNode(true));
 }
Esempio n. 8
0
 protected virtual void OnProccessWhereStringStartsWithMemberNode(ISqlWhereCriteriaBuilder builder, StringStartsWithMemberNode memberNode, int memberIndex)
 {
     builder.AddMember(memberNode, memberIndex);
     builder.AddOp(new OperatorNode(Operator.Like()));
     builder.AddValue(new ValueNode(string.Concat(memberNode.Value, "%")));
 }
Esempio n. 9
0
 protected virtual void OnProcessWhereStringContainsMemberNode(ISqlWhereCriteriaBuilder builder, StringContainsMemberNode memberNode, int memberIndex)
 {
     builder.AddMember(memberNode, memberIndex);
     builder.AddOp(new OperatorNode(Operator.Like()));
     builder.AddValue(new ValueNode(string.Concat("%", memberNode.Value, "%").Replace("%%", "%")));
 }
Esempio n. 10
0
 protected virtual void OnProcessWhereLikeMemberNode(ISqlWhereCriteriaBuilder builder, LikeMemberNode memberNode, int memberIndex)
 {
     builder.AddMember(memberNode, memberIndex);
     builder.AddOp(new OperatorNode(Operator.Like()));
     builder.AddValue(new ValueNode(memberNode.Value));
 }