我有這種方法,我試圖生成文檔。如何在文檔代碼中使用IEnumerable <String>
/// <summary>
/// This method demonstrates taking a Func as argument and perform that action(Func) on a list of strings.</summary>
/// <param name="listOfStrings"> ... </param>
/// <param name="ActionToPerformOnEach"> ... </param>
/// <returns>Returns an <see cref="IEnumerable{String}" /> which has elements that resulted due to the Func action </returns>
public static IEnumerable<String> ActOnListWithFunc(List<string> listOfStrings, Func<string, string> ActionToPerformOnEach) {
foreach (string s in listOfStrings) {
string actedString = ActionToPerformOnEach(s);
yield return actedString;
}
}
這會產生這樣的(僅返回值部分所示)文檔
Return Value
Type: IEnumerable<String>
Returns an IEnumerable<T> which has elements that resulted due to the Func action
凡我所描述的方法的返回值,我想用IEnumerable的<串>但如果你看它的描述,它正在生成IEnumerable <T>。 類型:(上面的第二行)雖然被正確拾取爲IEnumerable <字符串>。只是返回值的描述行不正確。
我們如何描述IEnumerable的<串>或IEnumerable的<INT>或參數的說明任何其他特定枚舉類型或返回值,即betwween <PARAM> < /參數>或<回報> < /返回>被記錄的方法的標籤。
可能重複[如何在XML文檔中引用泛型類和方法](http://stackoverflow.com/questions/532166/how-to -reference-generic-classes-and-methods-in-xml-documentation) –
我已經在該方法的Returns屬性中使用了,但它沒有顯示特定的泛型類型串)。請查看發佈的第二個補丁的第三行。它讀取IEnumerable 而不是IEnumerable –
Jatin