public SQCondition(IWriteSQL operandA, SQRelationOperators op, IWriteSQL operandB, bool invertLogic) { OperandA = operandA; Operator = op; OperandB = operandB; InvertMeaning = invertLogic; }
public ORMCond(string propertyChain, SQRelationOperators op, object value, bool invertLogic) { PropertyChain = propertyChain; Operator = op; Value = value; InvertMeaning = invertLogic; }
protected virtual string GetOperatorText(SQRelationOperators op) { switch (op) { case SQRelationOperators.Equal: return("="); case SQRelationOperators.After: case SQRelationOperators.GreaterThan: return(">"); case SQRelationOperators.GreaterThanOrEqual: return(">="); case SQRelationOperators.Before: case SQRelationOperators.LessThan: return("<"); case SQRelationOperators.LessThanOrEqual: return("<="); case SQRelationOperators.Contains: case SQRelationOperators.Like: case SQRelationOperators.EndsWith: case SQRelationOperators.StartsWith: return("LIKE"); case SQRelationOperators.In: return("IN"); case SQRelationOperators.Is: return("IS"); default: return("="); } }
/// <summary> /// Append an "and" condition. Pass the settings for a SQCondition /// </summary> /// <param name="operandA"></param> /// <param name="op"></param> /// <param name="operandB"></param> /// <returns>The current condition</returns> public SQConditionBase And(object operandA, SQRelationOperators op, object operandB) { return(And(operandA, op, operandB, false)); }
/// <summary> /// Append an "or" condition. Pass the settings for a SQCondition /// </summary> /// <param name="operandA"></param> /// <param name="op"></param> /// <param name="operandB"></param> /// <returns>The current condition</returns> public SQConditionBase Or(IWriteSQL operandA, SQRelationOperators op, IWriteSQL operandB, bool invert) { return(Or(new SQCondition(operandA, op, operandB, invert))); }
/// <summary> /// Append an "or" condition. Pass the settings for a SQCondition /// </summary> /// <param name="operandA"></param> /// <param name="op"></param> /// <param name="operandB"></param> /// <returns>The current condition</returns> public SQConditionBase Or(IWriteSQL operandA, SQRelationOperators op, IWriteSQL operandB) { return(Or(new SQCondition(operandA, op, operandB, false))); }
/// <summary> /// Enter operands as strings to be written as they are /// </summary> public SQCondition(string operandA, SQRelationOperators op, string operandB, bool invertLogic) : this(new SQCustomSQL(operandA), op, new SQCustomSQL(operandB), invertLogic) { }
/// <summary> /// Append an "or" condition. Pass the settings for a SQCondition /// </summary> /// <param name="operandA"></param> /// <param name="op"></param> /// <param name="operandB"></param> /// <returns>The current condition</returns> public SQConditionBase Or(object operandA, SQRelationOperators op, object operandB) { return(Or(new SQCondition(operandA, op, operandB, false))); }
/// <summary> /// Append an "and" condition. Pass the settings for a SQCondition /// </summary> /// <param name="operandA"></param> /// <param name="op"></param> /// <param name="operandB"></param> /// <returns>The current condition</returns> public SQConditionBase And(ISQLWriter operandA, SQRelationOperators op, ISQLWriter operandB, bool invert) { return(And(new SQCondition(operandA, op, operandB, invert))); }
public ORMCondBase Or(string operandA, SQRelationOperators op, string operandB, bool invert) { return(Or(new ORMCond(operandA, op, operandB, invert))); }
public ORMCondBase Or(string operandA, SQRelationOperators op, string operandB) { return(Or(operandA, op, operandB, false)); }
public SQCondition(IWriteSQL operandA, SQRelationOperators op, IWriteSQL operandB) : this(operandA, op, operandB, false) { }
/// <summary> /// The first operand is written as is, the second is converted to a parameter /// </summary> public SQCondition(string operandA, SQRelationOperators op, object operandB) : this(new SQCustomSQL(operandA), op, new SQParameter("", operandB), false) { }
/// <summary> /// Both operands are converted to unnamed parameters /// </summary> public SQCondition(object operandA, SQRelationOperators op, object operandB, bool invertLogic) : this(new SQParameter("", operandA), op, new SQParameter("", operandB), invertLogic) { }
/// <summary> /// Both operands are converted to unnamed parameters /// </summary> public SQCondition(object operandA, SQRelationOperators op, object operandB) : this(operandA, op, operandB, false) { }
/// <summary> /// Append an "and" condition. Pass the settings for a SQCondition /// </summary> /// <param name="operandA"></param> /// <param name="op"></param> /// <param name="operandB"></param> /// <returns>The current condition</returns> public SQConditionBase And(object operandA, SQRelationOperators op, object operandB, bool invert) { return(And(new SQCondition(operandA, op, operandB, invert))); }
/// <summary> /// Append an "and" condition. Pass the settings for a SQCondition /// </summary> /// <param name="operandA"></param> /// <param name="op"></param> /// <param name="operandB"></param> /// <returns>The current condition</returns> public SQConditionBase And(ISQLWriter operandA, SQRelationOperators op, ISQLWriter operandB) { return(And(operandA, op, operandB, false)); }
public ORMCondBase And(string operandA, SQRelationOperators op, object operandB) { return(And(operandA, op, operandB, false)); }
/// <summary> /// Append an "or" condition. Pass the settings for a SQCondition /// </summary> /// <param name="operandA"></param> /// <param name="op"></param> /// <param name="operandB"></param> /// <returns>The current condition</returns> public SQConditionBase Or(string operandA, SQRelationOperators op, object operandB, bool invert) { return(Or(new SQCondition(operandA, op, operandB, invert))); }
public ORMCondBase And(string operandA, SQRelationOperators op, object operandB, bool invert) { return(And(new ORMCond(operandA, op, operandB, invert))); }
public ORMCond(string propertyChain, SQRelationOperators op, object value) : this(propertyChain, op, value, false) { }
/// <summary> /// Enter operands as strings to be written as they are /// </summary> public SQCondition(string operandA, SQRelationOperators op, string operandB) : this(operandA, op, operandB, false) { }