c#

位置:IT落伍者 >> c# >> 浏览文章

.net方法参数注释编写实例


发布日期:2021年08月24日
 
.net方法参数注释编写实例

主要是examplecode标记等的运用怕忘了所以记录一下

#region GetLatestJobInfo

///<summary>

///获取最新的职位信息

///</summary>

///<example>

///<code>

///<font face=>宋体 size=>

/// [C#]

/// public class MyClass

/// {

/// public void myMethod()

/// {

/// <font color=green>//创建web service对象</font>

/// wsJobPosition position = new wsJobPosition();

///

/// <font color=green>//获取最新条信息</font>

/// <font color=green>//前一个参数表示获取的记录条数后一个参数表示排序字段表示按dtCreate降序</font>

/// DataSet ds = positionGetLatestJobInfo( );

///

/// <font color=green>//其它代码</font>

/// }

///}

///

///</font>

///</code>

///</example>

///<param name=topNumber>显示最新条数</param>

///<param name=orderField>降序排列的字段默认为dtCreate</param>

///<returns>返回某字段降序排列的前N条记录</returns>

[WebMethod]

public DataSet GetLatestJobInfo(int topNumber string orderField)

{

DataSet ds = new DataSet();

DataTable dt;

orderField = orderField == ? dtCreate : orderField;

string sql = SELECT TOP {} * FROM Job_Position order by {} desc;

sql = stringFormat(sql topNumber orderField);

dt = clsFactoryCreate()GetDataTable(sql);

dsTablesAdd(dt);

return ds;

}

#endregion

用NDoc生成的说明如下:

获取最新的职位信息

public DataSet GetLatestJobInfo(

int topNumber

string orderField

);

参数

topNumber

显示最新条数

orderField

  降序排列的字段默认为dtCreate

返回值

  返回某字段降序排列的前N条记录

示例

[C#]

public class MyClass

{

public void myMethod()

{

//创建web service对象

wsJobPosition position = new wsJobPosition();

//获取最新条信息

//前一个参数表示获取的记录条数后一个参数表示排序字段表示按dtCreate降序

DataSet ds = positionGetLatestJobInfo( );

//其它代码

}

}

               

上一篇:C#对称加密解密算法

下一篇:VS2008中查看.NET源码的设置方法