Search code examples
c#overloadingxml-documentation

C#, XmlDoc: How to reference method overloads


If I have these two methods

public Foo Get(string bar) { ... }
public Foo Get(int bar) { ... }

And write this piece of xml documentation on a different method

/// <summary>
/// Has a close relation to the <see cref="Get"/> methods.
/// </summary>

I get a blue squiggly under Get, saying that it is an Ambiguous reference 'Get'. which is true, but I want it to reference both. What is the correct way of doing this? Or should am I only supposed to reference a single method overload?


Solution

  • Try

    /// Has a close relation to the <see cref="Get(string)"/>  
    /// and <see cref="Get(int)" /> methods.
    

    You may need full typenames but intellisense should help as soon as you put first bracket in.

    Hope that helps,

    Dan