Introduction
Use declarative approach to code with .NET attributes
()
What you should know
()
My programming setup and configuration
()
How to access the sample code on GitHub
()
1. Overview
Metadata and .NET assemblies
()
Metadata consumers
()
What is an attribute
()
Examine the .NET attribute classes
()
Reading metadata and code with reflection
()
2. Use an Attribute
Use the Obsolete attribute
()
See the attribute metadata in the .NET assembly
()
Attribute constructors and properties
()
Apply multiple attributes
()
3. Create a Custom JSON Serializer Attribute
Examine the JSON serializer project
()
Create the attribute
()
Use the attribute in another project
()
Write reflection code to discover the attribute
()
Create a parameterized attribute
()
Find parameters with reflection
()
4. Create a Custom Unit Test Framework
Examine the zUnit projects
()
Explore the unit test attributes
()
Use the unit test attributes
()
Load attributes
()
Show the attribute metadata
()
Run the unit tests
()
Create an Assert class
()
5. Examples of .NET Attributes
Bit field enums and the flags attribute
()
PropertyGrid and the Category attribute
()
The BindProperty attribute in ASP.NET Razor Pages
()
Logging and the CallerMemberName attribute
()