Svish Svish - 5 months ago 28
C# Question

How to reference generic classes and methods in xml documentation

When writing xml documentation you can use

<see cref="something">something</see>
, which works of course. But how do you reference a class or a method with generic types?

public class FancyClass<T>
public string FancyMethod<K>(T value) { return "something fancy"; }

If I was going to write xml documentation somewhere, how would I reference the fancy class? how can I reference a
? What about the method?

For example in a different class I wanted to let the user know that I will return an instance of
. How could I make a see cref thing for that?


To reference the method:

/// <see cref="FancyClass{T}.FancyMethod{K}(T)"/> for more information.