Beispiel #1
0
        public static string Convert(SelectValues value)
        {
            switch (value)
            {
            case SelectValues.Count:
                return("COUNT");

            case SelectValues.AllAttributes:
                return("ALL_ATTRIBUTES");

            case SelectValues.AllProjectedAttributes:
                return("ALL_PROJECTED_ATTRIBUTES");

            case SelectValues.SpecificAttributes:
                return("SPECIFIC_ATTRIBUTES");

            default:
                throw new ArgumentOutOfRangeException("Invalid SelectValues value");
            }
        }
Beispiel #2
0
 /// <summary>
 /// Returns a <see cref="string"/> that represents this instance.
 /// </summary>
 /// <returns>A <see cref="string"/> that represents this instance.</returns>
 public override string ToString()
 {
     return($"SELECT {(Count ? " COUNT " : "")} {(Distinct ? " DISTINCT " : " ")} {SelectValues.ToString(x => x.Name)} FROM {ObjectType.Name} {WhereClause} {(OrderByValues.Count > 0 ? "ORDER BY " + OrderByValues.ToString(x => x.ToString()) : "")} {(Skip > 0 ? "OFFSET " + Skip + " ROWS" : "")} {(Top > 0 ? "FETCH NEXT " + Top + " ROWS ONLY" : "")}");
 }