C# 14 introduces extension members, expanding beyond traditional extension methods to support static extension methods, static and instance extension properties, and extension operators. The new syntax uses extension blocks with receiver parameters, allowing developers to add static methods directly to types and create extension properties. While the syntax requires more nesting and may appear unfamiliar, it provides better alignment between how extensions are defined and used, with all existing extension methods remaining compatible.

11m read timeFrom andrewlock.net
Post cover image
Table of contents
Background: Extension methodsExtension members and extension everythingA case study: NetEscapades.EnumGeneratorsSummary

Sort: