Course
Skills
C# Reflection
In this course you’ll learn when reflection is useful and how to use it with C# 12 in .NET 8.
What you'll learn
In this course, C# Reflection, you’ll learn how to use reflection in C# 12. First, you’ll explore for which use cases reflection can be useful. Next, you’ll discover how to use reflection to inspect & manipulate classes and objects at runtime. Finally, you’ll learn how to apply reflection when working with generics. When you’re finished with this course, you’ll have in-depth knowledge on using reflection with C# 12.
Table of contents
Course Overview
1min
Using Reflection for Inspecting Metadata
45mins
- Introduction 2m
- Coming Up 1m
- Course Prerequisites 0m
- Frameworks and Tooling 2m
- Defining Reflection 5m
- Reflection Use Cases and Considerations 3m
- Demo - Introducing the Demo Application 1m
- Demo - Inspecting a Type 13m
- Demo - Getting Info About a Type 7m
- Inspecting Specialized Forms of MethodInfo 2m
- Early and Late Binding 3m
- Demo - Controlling the Way Reflection Searches with BindingFlags 2m
- Summary 2m
Instantiating and Manipulating Objects
55mins
- Coming Up 1m
- Demo - Introducing the Demo Applications 1m
- Demo - Invoking Constructors 8m
- Demo - Invoking a Constructor Dynamically by Name 10m
- Demo - Working with an Object Through Interfaces 3m
- Demo - Working with an Object Through Dynamics 3m
- Demo - Getting and Setting Properties and Fields 7m
- Demo - Invoking Methods 3m
- Reflection Behind the Scenes 3m
- Writing a Self-configuring Network Monitor 2m
- Demo - Writing a Self-configuring Network Monitor 13m
- Summary 3m
Using Reflection with Generics
34mins
- Coming Up 1m
- A Few Words on Generics 3m
- Demo - Inspecting Generic Instances 5m
- Demo - Creating Generic Instances 5m
- Demo - Invoking Generic Methods 3m
- Building an IoC Container 3m
- Demo - Building an IoC Container - The Basics 9m
- Demo - Building an IoC container – Supporting Constructor Injection and Unbound Generics 5m
- Summary 1m