# YamlNodeFluent

The fluent methods of YamlNode, generated from its public properties: A property-named method sets a property and a singular-named method adds to a collection…

Class 

`OfficeIMO.Yaml`

**Namespace**

`OfficeIMO.Yaml`

**Assembly**

`OfficeIMO.Yaml`

**Modifiers**

static

The fluent methods of [YamlNode](/api/yaml/officeimo-yaml-yamlnode/), generated from its public properties: A property-named method sets a property and a singular-named method adds to a collection, both returning the same instance.

## Inheritance

- object
- YamlNodeFluent

Filter members 

Show inherited

## Methods

`public static TSelf Anchor<TSelf>(TSelf yamlNode, string? name)` [#](#method-anchor-string)

Sets, renames or removes (null) the node's anchor. Renaming updates every alias that refers to the node; removing an anchor that aliases still use fails.

Type Parameters

**TSelf**

Parameters

**yamlNode TSelf required**

The instance.

**name string? required**

The value.

Returns

`TSelf` The same instance.

`public static TSelf LeadingComment<TSelf>(TSelf yamlNode, string? text)` [#](#method-leadingcomment-string)

Replaces the comment lines above the node's entry; each line of text becomes one # line comment at the entry's indentation. null or an empty string removes them.

Type Parameters

**TSelf**

Parameters

**yamlNode TSelf required**

The instance.

**text string? required**

The value.

Returns

`TSelf` The same instance.

`public static TSelf SpaceBefore<TSelf>(TSelf yamlNode, bool value = true)` [#](#method-spacebefore-boolean)

Sets whether a blank line separates the node's entry from the previous content.

Type Parameters

**TSelf**

Parameters

**yamlNode TSelf required**

The instance.

**value bool = true optional**

The value. True when omitted.

Returns

`TSelf` The same instance.

`public static TSelf Tag<TSelf>(TSelf yamlNode, string? tag)` [#](#method-tag-string)

Sets or removes (null) the node's tag, in the resolved form [YamlNode.Tag](/api/yaml/officeimo-yaml-yamlnode/) reports (tag:yaml.org,2002:str, !Ref). Tags change how a scalar resolves; they never activate .NET types.

Type Parameters

**TSelf**

Parameters

**yamlNode TSelf required**

The instance.

**tag string? required**

The value.

Returns

`TSelf` The same instance.

`public static TSelf TrailingComment<TSelf>(TSelf yamlNode, string? text)` [#](#method-trailingcomment-string)

Sets the comment at the end of the node's line (value # text), or removes it with null.

Type Parameters

**TSelf**

Parameters

**yamlNode TSelf required**

The instance.

**text string? required**

The value.

Returns

`TSelf` The same instance.

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

<!-- PowerForge markdown artifact sha256:996A4B4182FED2C48FD195432E305E19A13B8B4C17EB34DDF58C03ADBDDF40A2 -->
