3

If i have the following function:

void ReadData(Action<DataContext> action) {}

how can i reference it in seealso construct?

<seealso cref="ReadData(Action<DataContext>)"/>

complains "The character '<' cannot be used in an attribute value". Changing '<' and '>' to '{' and '}' works but makes it open generic parameter.

2
  • Maybe by using the entity representations &lt; and &gt;? Commented Jul 19, 2011 at 8:42
  • Sorry, what do you mean by "makes it open generic parameter"? Commented Jul 19, 2011 at 8:45

2 Answers 2

5
<seealso cref="ReadData(Action{DataContext})"/>
Sign up to request clarification or add additional context in comments.

Comments

4

From section A.3.1 of the C# 4 spec:

  • Arguments that use generic type parameters defined on types are encoded using the backtick character followed by the zero-based index of the type parameter.
  • Arguments that use generic type parameters defined in methods use a double-backtick instead of the single backtick used for types.
  • Arguments that refer to constructed generic types are encoded using the generic type, followed by "{", followed by a comma-separated list of type arguments, followed by "}".

(I've written backtick explicitly rather than including the character due to markdown limitations.)

Of these, the last bullet point is what you're after, so Action{DataContext} as per Petar's answer. I only included this answer for extra reference, basically :)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.