C of 4.0 unusual syntax
- 2020-05-07 20:16:28
- OfStack
: specify parameters
Where condition: "WHERE Id =" + userId specifies that condition is an QueryTable method parameter
?? The operator
Is equal to the
public DataTable TodayToTable(int userId)
{
return userId > 0 ? V_CN_TASK_VALID_SCORING_TODAY.QueryTable(condition: " WHERE subcontractors Id = " + userId) : null;
}
Where condition: "WHERE Id =" + userId specifies that condition is an QueryTable method parameter
/// <summary>
/// Queries the records for the specified table
/// </summary>
/// <param name="table"> The name of the table </param>
/// <param name="fields">SELECT List of field names for the clause </param>
/// <param name="condition"> Query conditions </param>
/// <param name="args"> A list of command parameter names separated by half - Angle commas </param>
/// <param name="vals"> Array of command argument values ( optional )</param>
/// <returns> The query results </returns>
public static DataTable QueryTable(this string table, string fields = null, int? limit = null, string condition = null, string args = null, params object[] vals)
{
return GetTable(table.QueryDataSet(fields, limit, condition, args, vals), 0);
}
?? The operator
var m_queryFields = fields.TrimNull() ?? "*";
Is equal to the
var m_queryFields = fields.TrimNull() ? "*" : fields.TrimNull();