Skip to content

Unbound generic types and nameof C# 14.0correctness

Use the `nameof` keyword with generic definitions.

The nameof operator C# 6.0 previously could only be used with generic types when all the type arguments had been satisfied, e.g. nameof(List<int>)

C# 14 allows nameof to now also be used with the generic definition (also known as an unbound generic type), e.g. nameof(List<>)

:::

More information