/// <summary> /// Use the value from col if this column is null. /// "CASE WHEN " + this.Id(langCode) + " IS NOT NULL THEN " + Id(langCode) + /// " ELSE " + col.Id() + " END " + /// " AS " + this.Label(langCode) /// </summary> /// <param name="langCode"></param> /// <param name="col"></param> /// <returns></returns> public string ForSelectWithFallback(string langCode, Col col) { return("CASE WHEN " + this.Id(langCode) + " IS NOT NULL THEN " + this.Id(langCode) + " ELSE " + col.Id() + " END " + " AS " + this.Label(langCode) + " "); }
/// <summary> /// Id() + " = " + otherCol.Id() /// </summary> /// <param name="otherCol">The column this columns must be equal to.</param> /// <returns></returns> public string Is(Col otherCol) { return(this.Id() + " = " + otherCol.Id()); }