سؤال

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

هل كانت مفيدة؟

المحلول

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

<see cref="Enumerable.SingleOrDefault{TSource}(IEnumerable{TSource})"/>
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top