/// <summary> /// Converts an instance of order field into an enumerable list of fields. /// </summary> /// <param name="orderField">The order field instance to be converted.</param> /// <param name="alias">The alias to be used for conversion.</param> /// <returns>An enumerable list of fields.</returns> public static string AsField(this OrderField orderField, string alias) { if (string.IsNullOrEmpty(alias)) { return(string.Concat(orderField.Name, " ", orderField.GetOrderText())); } else { return(string.Concat(alias, ".", orderField.Name, " ", orderField.GetOrderText())); } }
/// <summary> /// Converts an instance of order field into an enumerable list of fields. /// </summary> /// <param name="orderField">The order field instance to be converted.</param> /// <param name="alias">The alias to be used for conversion.</param> /// <param name="dbSetting">The currently in used <see cref="IDbSetting"/> object.</param> /// <returns>An enumerable list of fields.</returns> public static string AsField(this OrderField orderField, string alias, IDbSetting dbSetting) { if (string.IsNullOrEmpty(alias)) { return(string.Concat(orderField.Name.AsField(dbSetting), " ", orderField.GetOrderText())); } else { return(string.Concat(orderField.Name.AsAliasField(alias, dbSetting), " ", orderField.GetOrderText())); } }
/// <summary> /// Converts an instance of order field into an stringified alias-formatted string. /// </summary> /// <param name="orderField">The order field to be converted.</param> /// <param name="alias">The alias to be used for conversion.</param> /// <returns>A string value for the stringified alias-formatted converted string.</returns> internal static string AsAliasField(this OrderField orderField, string alias) { return($"{alias}.[{orderField.Name}] {orderField.GetOrderText()}"); }
/// <summary> /// Converts an instance of order field into an enumerable list of fields. /// </summary> /// <param name="orderField">The order field instance to be converted.</param> /// <returns>An enumerable list of fields.</returns> internal static string AsField(this OrderField orderField) { return($"[{orderField.Name}] {orderField.GetOrderText()}"); }
/// <summary> /// Converts an instance of order field into an stringified alias-formatted string. /// </summary> /// <param name="orderField">The order field to be converted.</param> /// <param name="alias">The alias to be used for conversion.</param> /// <returns>A string value for the stringified alias-formatted converted string.</returns> internal static string AsAliasField(this OrderField orderField, string alias) { return(string.Concat(alias, ".", orderField.Name, " ", orderField.GetOrderText())); }
/// <summary> /// Converts an instance of order field into an enumerable list of fields. /// </summary> /// <param name="orderField">The order field instance to be converted.</param> /// <returns>An enumerable list of fields.</returns> internal static string AsField(this OrderField orderField) { return(string.Concat(orderField.Name, " ", orderField.GetOrderText())); }