. Net method parameter annotation compiling example [original]

Source: Internet
Author: User
Tags code tag

It is mainly used for example, code tag, etc. If you forget it, record it. # region getlatestjobinfo /// <summary> /// obtain the latest job information /// </Summary> /// <example> /// <code> /// <font face = "> "size = "2"> // [C #] // public class myclass /// {// public void mymethod () /// {// <font color = "green"> // create a web service object </font> // wsjobposition position = new wsjobposition (); ///// <font color = "green"> // obtain the latest information </font> /// <font color = "green"> // The previous parameter table Indicates the number of records obtained. The last parameter indicates the sorting field. "" indicates the order by dtcreate in descending order. </font> // dataset DS = position. getlatestjobinfo (10 ,""); ///// <font color = "green"> // other Code </font> ///} // </font> /// </code> /// </example> /// <Param name = "topnumber"> display the latest number </param> /// <Param name =" orderfield "> in descending order, dtcreate </param> /// <returns> returns the first N records of a field in descending order. </returns> [webmethod] public dataset getlatestjobinfo (INT topnumber, string orderfie LD) {dataset DS = new dataset (); datatable DT; orderfield = ""? "Dtcreate": orderfield; string SQL = "select top {0} * From job_position order by {1} DESC"; SQL = string. format (SQL, topnumber, orderfield); dt = clsfactory. create (). getdatatable (SQL); DS. tables. add (DT); Return DS ;}# endregion

Ndoc generation is described as follows:

Obtain the latest job information

Public dataset getlatestjobinfo (
Int topnumber,
String orderfield
);

Parameters
Topnumber
Display the latest number
Orderfield
Fields in descending order. The default value is dtcreate.

Return Value
Returns the first N records in descending order of a field.

Example

[C #]
Public class myclass
{
Public void mymethod ()
{
// Create a web service object
Wsjobposition position = new wsjobposition ();

// Obtain the latest 10 pieces of information
// The previous parameter indicates the number of records obtained, and the last parameter indicates the sorting field. "" indicates the descending order of dtcreate.
Dataset DS = position. getlatestjobinfo (10 ,"");

// Other code
}
}

 

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.