Skip to main content
InterviewHubPRO
Section Overview
Q32

Question 32 of 50

Part 3: CLR Internals, Native AOT & Production Diagnostics (25 - 35)

64%
C# & CLR Internals (50 Qs)•Part 3: CLR Internals, Native AOT & Production Diagnostics (25 - 35)

What are Extension Methods in C# and how are they lowered by the compiler?

senior LevelcsharpCLR Internals

In Simple Words: Extension methods allow adding methods to existing types without modifying the source. The compiler simply rewrites myObject.MyExtension() into a static method call MyExtensionClass.MyExtension(myObject).