Member Helpers

Member helpers work with .NET types, members, and references. These helpers provide language-specific rendering for code elements and provide proper URLs cross-referencing documentation pages.

HelperPurposeParametersReturns
memberDefinitionRenders definition of a type or type member according to language syntaxelementN/A
memberSignatureRenders signature of a namespace, type or type member according to language syntaxelementN/A
memberNameReturns name of a namespace, type or type member, including its declaring typeelementstring
memberUrlReturns URL to documentation page of a namespace, type, or type memberelementuri
memberCategoryReturns category of a namespace, type, or type memberelementstring

memberDefinition

Renders a complete definition for a code element directly to the output.

The definition includes attributes, access modifiers, return type, name, parameters, and constraints (if any) of the member formatted according to the language syntax.

Syntax:

{{#memberDefinition element}}

Parameters:

Examples:

{{#memberDefinition model}}
{{#memberDefinition 'M:System.DateTime.ToString(System.String)'}}  {{!-- public string ToString(string format) --}}

memberSignature

Renders a formatted signature for a code element directly to the output.

The signature includes name and parameters (if any) of the code element formatted according to the language syntax.

Syntax:

{{#memberSignature element}}

Parameters:

Examples:

{{#memberSignature model}}
{{#memberSignature 'M:System.DateTime.ToString(System.String)'}}  {{!-- ToString(string) --}}

memberName

Returns the display name of a code element, including its declaring type if applicable.

The name is formatted according to the language syntax.

Syntax:

{{#memberName element}}

Parameters:

Returns: Display name string

Examples:

{{#memberName model}}
{{#memberName 'M:System.DateTime.ToString(System.String)'}}  {{!-- DateTime.ToString --}}

memberUrl

Returns the URL to the documentation page of a code element.

Based on the context, the returned URL can be either relative or absolute. In case of a relative URL, it is relative to the current documentation page.

Syntax:

{{#memberUrl element}}

Parameters:

Returns: URI object representing the URL to the documentation page

Examples:

{{#memberUrl model}}
{{#memberUrl 'M:System.DateTime.ToString(System.String)'}}  {{!-- https://learn.microsoft.com/en-us/dotnet/api/system.datetime.tostring#system-datetime-tostring(system-string) --}}

memberCategory

Determines the category of a code element

Syntax:

{{#memberCategory element}}

Parameters:

Returns: A string representing the category of the member, such as:

Examples:

{{#memberCategory model}}
{{#memberCategory 'M:System.DateTime.ToString(System.String)'}}  {{!-- Method }}