# OfficeListMerge

How a structured-document merge, such as YAML or TOML, combines an overlay list (a YAML sequence, a TOML array or array of tables) with the base list…

Class 

`OfficeIMO`

**Namespace**

`OfficeIMO`

**Assembly**

`OfficeIMO.Core`

**Source revision**

`78706d0f9c0e` with working tree changes

**Source**

[OfficeListMerge.cs:32](https://github.com/EvotecIT/OfficeIMO/blob/78706d0f9c0ecb8c19bb788cfda578b014be7948/Sources/OfficeIMO.Core/Text/OfficeListMerge.cs#L32)

**Modifiers**

sealed

How a structured-document merge, such as YAML or TOML, combines an overlay list (a YAML sequence, a TOML array or array of tables) with the base list at the same path: [OfficeListMerge.Replace](/api/core/officeimo-officelistmerge/) (the default), [OfficeListMerge.Append](/api/core/officeimo-officelistmerge/) or [OfficeListMerge.MergeByKey](/api/core/officeimo-officelistmerge/).

## Inheritance

- object
- OfficeListMerge

## Usage

Explore 3 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Returned or exposed by 3

- Method [OfficeListMerge.MergeByKey](/api/core/officeimo-officelistmerge/#method-mergebykey-string)
- Property [OfficeListMerge.Append](/api/core/officeimo-officelistmerge/#property-append)
- Property [OfficeListMerge.Replace](/api/core/officeimo-officelistmerge/#property-replace)

Filter members 

Show inherited

## Methods

`public static OfficeListMerge MergeByKey(string keyName)` [#](#method-mergebykey-string)

[OfficeListMerge.cs:32](https://github.com/EvotecIT/OfficeIMO/blob/78706d0f9c0ecb8c19bb788cfda578b014be7948/Sources/OfficeIMO.Core/Text/OfficeListMerge.cs#L32)

Mapping or table items are matched by the value of a key, for example containers by name: an overlay item merges into the first base item with an equal value under that key that no earlier overlay item matched, and items without a match are appended. A list whose overlay items are not all mappings with a value under the key is replaced as with [OfficeListMerge.Replace](/api/core/officeimo-officelistmerge/).

Parameters

**keyName string required**

The key whose value identifies an item.

Returns

`OfficeListMerge`

Exceptions

- `ArgumentException` – keyName is null or empty.

## 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?`

## Properties

`public static OfficeListMerge Replace { get; }` [#](#property-replace)

[OfficeListMerge.cs:18](https://github.com/EvotecIT/OfficeIMO/blob/78706d0f9c0ecb8c19bb788cfda578b014be7948/Sources/OfficeIMO.Core/Text/OfficeListMerge.cs#L18)

The overlay's items replace the base items. Items whose values already match keep their text and comments; only the items that differ change.

`public static OfficeListMerge Append { get; }` [#](#property-append)

[OfficeListMerge.cs:21](https://github.com/EvotecIT/OfficeIMO/blob/78706d0f9c0ecb8c19bb788cfda578b014be7948/Sources/OfficeIMO.Core/Text/OfficeListMerge.cs#L21)

The overlay's items are appended after the base items.

<!-- PowerForge markdown artifact sha256:BE55A48B8DCB0217D14D6CCED466B4D97339A259ACD0BFBC57F1758FF0FC5240 -->
