C # (4.0) uncommon syntax

Source: Internet
Author: User

: Specified parameter Copy codeThe Code is as follows: public DataTable TodayToTable (int userId)
{
Return userId> 0? V_CN_TASK_VALID_SCORING_TODAY.QueryTable (condition: "WHERE receiver Id =" + userId): null;
}

The condition: "WHERE receiver Id =" + userId indicates that the specified parameter condition is a parameter of the QueryTable method.Copy codeThe Code is as follows: // <summary>
/// Query records of a specified table
/// </Summary>
/// <Param name = "table"> table name </param>
/// <Param name = "fields"> list of field names in the SELECT clause </param>
/// <Param name = "condition"> query condition </param>
/// <Param name = "args"> List of command parameter names separated by commas </param>
/// <Param name = "vals"> array of command parameter values (optional) </param>
/// <Returns> query result </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 );
}

?? OperatorCopy codeThe Code is as follows: var m_queryFields = fields. TrimNull ()?? "*";

EqualCopy codeThe Code is as follows: var m_queryFields = fields. TrimNull ()? "*": Fields. TrimNull ();

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.