internal override IExp RemoveExpIfNull(ICaster caster) { if (_rOperand == null || _lOperand == null) { return(null); } if (_rOperand is Literal) { if (caster.IsNullPropertyValue(((Literal)_rOperand).Value)) { return(null); } } if (_lOperand is Literal) { if (caster.IsNullPropertyValue(((Literal)_lOperand).Value)) { return(null); } } return(this); }
internal override IExp RemoveExpIfNull(ICaster caster) { List <IElement> newOperands = new List <IElement>(); for (int i = 0; i <= _operands.Length - 1; i++) { if (_operands[i] == null) { continue; } else if (_operands[i] is Literal && caster.IsNullPropertyValue(((Literal)_operands[i]).Value)) { continue; } newOperands.Add(_operands[i]); } if (newOperands.Count == 0) { return(null); } return(new InExp(_lOperand, newOperands.ToArray())); }
/// <summary> /// 値がNULL表現値か否か判定する /// </summary> /// <param name="value">判定する値</param> /// <returns></returns> /// <remarks>SqlAccesssorDataSourceで利用します</remarks> public bool IsNullPropertyValue(object value) { if (this.IsDisposed) { throw new InvalidOperationException("Dbオブジェクトは既に破棄されています"); } return(_aCaster.IsNullPropertyValue(value)); }
internal override IExp RemoveExpIfNull(ICaster caster) { if (_fromOperand == null && _toOperand == null) { return(null); } else if (_fromOperand == null) { return(new LessThanOrEqual(_operand, _toOperand)); } else if (_toOperand == null) { return(new GreaterThanOrEqual(_operand, _fromOperand)); } else if (_fromOperand is Literal && _toOperand is Literal) { if (caster.IsNullPropertyValue(((Literal)_fromOperand).Value) && caster.IsNullPropertyValue(((Literal)_toOperand).Value)) { return(null); } else if (caster.IsNullPropertyValue(((Literal)_fromOperand).Value)) { return(new LessThanOrEqual(_operand, _toOperand)); } else if (caster.IsNullPropertyValue(((Literal)_toOperand).Value)) { return(new GreaterThanOrEqual(_operand, _fromOperand)); } } else if (_fromOperand is Literal && _toOperand is val) { if (caster.IsNullPropertyValue(((Literal)_fromOperand).Value)) { return(new LessThanOrEqual(_operand, _toOperand)); } } else if (_fromOperand is val && _toOperand is Literal) { if (caster.IsNullPropertyValue(((Literal)_toOperand).Value)) { return(new GreaterThanOrEqual(_operand, _fromOperand)); } } return(this); }