LANGUAGE

Extension block

C# 14 syntax for extension members inside an eligible static class.

Formal Syntax & Structure

csharp syntaxcsharp
extension(int value) { public bool IsEvenValue => value % 2 == 0; }

Working Example

Example Snippetcsharp
// Documentary fragment; supply surrounding declarations as needed.extension(int value) { public bool IsEvenValue => value % 2 == 0; }
C# & .NET Reference