# GetDictionaryIgnoredEntries()

> Returns the duplicate-key and null-key placeholder rows of the serialized dictionary that this property refers to.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor](/engine/6000.7/script-reference/unityeditor.md)
* **Assembly:** UnityEditor.CoreModule

```csharp
public DictionaryIgnoredEntries GetDictionaryIgnoredEntries()
```

### Returns

| Type                                                                                                | Description                                                                                                                                                                                                                                                          |
| --------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [DictionaryIgnoredEntries](/engine/6000.7/script-reference/unityengine/dictionaryignoredentries.md) | A [DictionaryIgnoredEntries](/engine/6000.7/script-reference/unityengine/dictionaryignoredentries.md) value whose two index arrays identify the ignored rows. Both arrays are empty when the property is not a serialized dictionary or when it has no ignored rows. |

### Remarks

A serialized dictionary can hold rows that have no place in the runtime Dictionary: rows whose key duplicates an earlier key, and null-key placeholder rows that the Inspector keeps so a user can edit them. Unity excludes both kinds when it builds the live dictionary, but preserves them in the serialized data. This method reports both kinds in a single pass and returns their positions in the dictionary's underlying serialized array of key/value pairs, split by reason into [DictionaryIgnoredEntries.duplicateEntryIndices](/engine/6000.7/script-reference/unityengine/dictionaryignoredentries/duplicateentryindices.md) and [DictionaryIgnoredEntries.nullKeyEntryIndices](/engine/6000.7/script-reference/unityengine/dictionaryignoredentries/nullkeyentryindices.md). The indices are in insertion order and stay stable across Inspector re-sorts because they reference the serialized array rather than the displayed row order.

Resolving the ignored-entry identifier is the expensive part of the operation, and this method does it only once for both sets of rows.

This API is not supported when the underlying [SerializedObject](/engine/6000.7/script-reference/unityeditor/serializedobject.md) represents multiple selected targets, and throws an InvalidOperationException in that case. Multi-object editing of dictionaries is not supported.

Additional Resources: [DictionaryIgnoredEntries](/engine/6000.7/script-reference/unityengine/dictionaryignoredentries.md), [DictionaryDisplayAttribute](/engine/6000.7/script-reference/unityengine/dictionarydisplayattribute.md), [SerializedObject](/engine/6000.7/script-reference/unityeditor/serializedobject.md).

### Examples

```csharp
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;

[CreateAssetMenu(fileName = "IgnoredEntriesStats", menuName = "IgnoredEntriesStats")]
internal class IgnoredEntriesExample : ScriptableObject
{
    [DictionaryDisplay(keyLabel = "Name", valueLabel = "Score", keyColumnFraction = 0.6f)]
    [SerializeField]
    private Dictionary<string, int> playerScores = new Dictionary<string, int>();

    // Right-click the asset's Inspector header and choose "Log ignored entries" from the
    // 3-dot menu to log the rows that the Inspector shows but the runtime dictionary drops.
    [ContextMenu("Log ignored entries")]
    private void LogIgnoredEntries()
    {
        using (var serializedObject = new SerializedObject(this))
        {
            var dictionaryProperty = serializedObject.FindProperty(nameof(playerScores));
            DictionaryIgnoredEntries ignored = dictionaryProperty.GetDictionaryIgnoredEntries();
            Debug.Log($"'{nameof(playerScores)}' ignores {ignored.duplicateEntryIndices.Length} duplicate-key rows " +
                $"and {ignored.nullKeyEntryIndices.Length} null-key rows.");
        }
    }
}
```
