reflection
Code inspecting types, properties and methods at run time instead of knowing them at compile time.
In more detail
Model binding, serialisation and many libraries use it. It is flexible but slower, and it is what makes trimming unsafe, because the trimmer cannot see members only reached by reflection.
Related terms
- trimming — A publishing option that removes code the trimmer can prove is unused, making a self-contained app or image smaller.
- source generator — A compiler plug-in that writes extra C# code during the build, based on the code you wrote.
- property — A named value belonging to an object; in languages such as C# and Python, it can also be a member that looks like a field but runs code when read or written.
Taught in
- Classes, Interfaces, and Object-Oriented C# — Modern .NET Core, C# & Enterprise Microservices
- Source-Generated Mapping with Mapperly — Modern .NET Core, C# & Enterprise Microservices
- OpenTelemetry, Container Publishing and Trimming — Modern .NET Core, C# & Enterprise Microservices