Course
Skills
Using Reflection in a C# Application: Best Practices
In this course you’ll learn when reflection is useful and how to use it in .NET.
What you'll learn
Using reflection does not have to be difficult. In this course, Using Reflection in a C# Application: Best Practices, you’ll learn how to use reflection in C#. First, you’ll explore which use cases reflection can be useful. Next, you’ll discover how to use reflection to inspect and 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 in C#.
Table of contents
Course Overview
1min
Using Reflection for Inspecting Metadata
34mins
- Version Check 0m
- Coming Up 2m
- Course Prerequisites 1m
- Frameworks and Tooling 1m
- Defining Reflection 5m
- Reflection Use Cases and Considerations 2m
- Demo - Introducing the Demo Application 2m
- Demo - Inspecting a Type 8m
- Demo - Getting Info About a Type 5m
- 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
40mins
- Coming Up 1m
- Demo - Introducing the Demo Applications 1m
- Demo - Invoking Constructors 6m
- Demo - Invoking a Constructor Dynamically by Name 6m
- Demo - Working with an Object Through Interfaces 2m
- Demo - Working with an Object Through Dynamics 2m
- Demo - Getting and Setting Properties and Fields 6m
- Demo - Invoking Methods 2m
- Reflection Behind the Scenes 2m
- Writing a Self-configuring Network Monitor 1m
- Demo - Writing a Self-configuring Network Monitor 8m
- Summary 2m
Using Reflection with Generics
27mins
- Coming Up 1m
- A Few Words on Generics 2m
- Demo - Inspecting Generic Instances 4m
- Demo - Creating Generic Instances 4m
- Demo - Invoking Generic Methods 2m
- Building an IoC Container 2m
- Demo - Building an IoC Container - The Basics 7m
- Demo - Building an IoC Container – Supporting Constructor Injection and Unbound Generics 5m
- Summary 1m