Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to refer to an extension method of a generic class in XML comments

What is the proper XML-comment syntax to refer to the SingleOrDefault extension method on the IEnumerable interface?

My latest attempt is:

<see cref="IEnumerable{T}.SingleOrDefault{T}()"/>

The warning is:

XML comment on 'yourMethod' has cref attribute 'IEnumerable.SingleOrDefault()' that could not be resolved

like image 585
harley.333 Avatar asked May 02 '14 22:05

harley.333


1 Answers

You were close. The extension method belongs to the Enumerable class. Try:

<see cref="Enumerable.SingleOrDefault{TSource}(IEnumerable{TSource})"/>
like image 66
Ed Chapel Avatar answered Oct 16 '22 00:10

Ed Chapel