Examples from Chapter 14 (Attributes) of Programming C# 10.0 (O'Reilly).
- Example 1. Attributes in a unit test class
- Example 2. Attribute with constructor argument
- Example 3. Specifying optional attribute settings with properties
- Example 4. Assembly-level attributes
- Example 5. Module-level attribute
- Example 6. Attribute for compiler-generated property and event fields
- Example 7. Method and return value attributes
- Example 8. Lambda with attributes
- Example 9. A typical generated file with assembly-level attributes
- Example 10. Version attributes
- Example 11. Typical assembly description attributes
- Example 12. Applying caller info attributes to method parameters
- Example 13. INotifyPropertyChanged
- Example 14. A reusable INotifyPropertyChanged implementation
- Example 15. Raising a property changed event
- Example 16. The CallerArgumentExpressionAttribute in ArgumentNullException.ThrowIfNull
- Example 17. Calling a method that uses CallerArgumentExpressionAttribute
- Example 18. InternalsVisibleToAttribute
- Example 19. Interop attributes