/// <summary> /// Set next phrase. /// </summary> /// <param name="phrase">The next phrase.</param> /// <returns>The next phrase.</returns> public override IAPSqlPhrase SetNext(IAPSqlPhrase phrase) { if (phrase is APSqlOrderPhrase || phrase == null) return base.SetNext(phrase); throw new APDataException(APResource.GetString(APResource.APData_PhraseNextError, GetType().Name, phrase.GetType().Name, typeof(APSqlOrderPhrase).Name)); }
/// <summary> /// Set next phrase. /// </summary> /// <param name="phrase">The next phrase.</param> /// <returns>The next phrase.</returns> public override IAPSqlPhrase SetNext(IAPSqlPhrase phrase) { if (phrase is APSqlOrderPhrase || phrase == null) { return(base.SetNext(phrase)); } throw new APDataException(APResource.GetString(APResource.APData_PhraseNextError, GetType().Name, phrase.GetType().Name, typeof(APSqlOrderPhrase).Name)); }
/// <summary> /// Set next phrases. /// </summary> /// <param name="phrases">The phrases.</param> /// <returns>The last phrase.</returns> public IAPSqlPhrase SetNext(params IAPSqlPhrase[] phrases) { IAPSqlPhrase phrase = this; foreach (IAPSqlPhrase next in phrases) { phrase = phrase.SetNext(next); } return(phrase); }
/// <summary> /// Set next phrases. /// </summary> /// <param name="phrases">The IEnumerable phrases.</param> /// <returns>The last phrase.</returns> public IAPSqlPhrase SetNext(IEnumerable <IAPSqlPhrase> phrases) { IAPSqlPhrase phrase = this; foreach (IAPSqlPhrase next in phrases) { phrase = phrase.SetNext(next); } return(phrase); }
/// <summary> /// Set next phrase. /// </summary> /// <param name="phrase">The next phrase.</param> /// <returns>The next phrase.</returns> public override IAPSqlPhrase SetNext(IAPSqlPhrase phrase) { if (phrase is APSqlWherePhrase || phrase == null) return base.SetNext(phrase); //string typeName = phrase == null ? "null" : phrase.GetType().Name; string typeName = phrase.GetType().Name; throw new APDataException(APResource.GetString(APResource.APData_PhraseNextError, GetType().Name, typeName, typeof(APSqlWherePhrase).Name)); }
/// <summary> /// Set next phrase. /// </summary> /// <param name="phrase">The next phrase.</param> /// <returns>The next phrase.</returns> public override IAPSqlPhrase SetNext(IAPSqlPhrase phrase) { if (phrase is APSqlSelectPhrase) return base.SetNext(phrase); else if (phrase == null) return base.SetNext(new APSqlSelectPhrase(APSqlNullExpr.Expr)); string typeName = phrase.GetType().Name; throw new APDataException(APResource.GetString(APResource.APData_PhraseNextError, GetType().Name, typeName, typeof(APSqlSelectPhrase).Name)); }
/// <summary> /// Set next phrase. /// </summary> /// <param name="phrase">The next phrase.</param> /// <returns>The next phrase.</returns> public override IAPSqlPhrase SetNext(IAPSqlPhrase phrase) { if (phrase is APSqlWherePhrase || phrase == null) { return(base.SetNext(phrase)); } //string typeName = phrase == null ? "null" : phrase.GetType().Name; string typeName = phrase.GetType().Name; throw new APDataException(APResource.GetString(APResource.APData_PhraseNextError, GetType().Name, typeName, typeof(APSqlWherePhrase).Name)); }
/// <summary> /// Set next phrase. /// </summary> /// <param name="phrase">The next phrase.</param> /// <returns>The next phrase.</returns> public override IAPSqlPhrase SetNext(IAPSqlPhrase phrase) { if (phrase is APSqlSelectPhrase) { return(base.SetNext(phrase)); } else if (phrase == null) { return(base.SetNext(new APSqlSelectPhrase(APSqlNullExpr.Expr))); } throw new APDataException(APResource.GetString(APResource.APData_PhraseNextError, GetType().Name, phrase.GetType().Name, typeof(APSqlSelectPhrase).Name)); }
/// <summary> /// Create a new 'OR' condition group. /// </summary> /// <param name="phrases">The IEnumerable phrases.</param> public APSqlConditionOrPhrase(IEnumerable <APSqlWherePhrase> phrases) { IAPSqlPhrase phrase = null; foreach (APSqlWherePhrase next in phrases) { if (_child == null) { phrase = _child = next; } else { phrase = phrase.SetNext(next); } } }
/// <summary> /// Set next phrase. /// </summary> /// <param name="phrase">The next phrase.</param> /// <returns>The next phrase.</returns> public virtual IAPSqlPhrase SetNext(IAPSqlPhrase phrase) { _next = phrase; return phrase ?? this; }
/// <summary> /// Set next null. /// </summary> internal protected virtual void SetNextNull() { _next = null; }
/// <summary> /// Set next phrase. /// </summary> /// <param name="phrase">The next phrase.</param> /// <returns>The next phrase.</returns> public virtual IAPSqlPhrase SetNext(IAPSqlPhrase phrase) { _next = phrase; return(phrase ?? this); }
/// <summary> /// Set next phrase. /// </summary> /// <param name="phrase">The next phrase.</param> /// <returns>The next phrase.</returns> public IAPSqlPhrase SetNext(IAPSqlPhrase phrase) { throw new NotImplementedException(); }