Examining Source Generators
In this chapter, we will look at writing code that generates code. Even though this chapter isn’t directly related to Blazor development, it still has a connection to Blazor, as we’ll discover.
The subject of source generators is a book on its own, but I wanted to introduce it since they are used by Blazor and, honestly, it is one of my favorite features.
I am the kind of person that spends a day writing source code that saves me 10 minutes if I know I will need to repeat those 10 minutes over and over again. Repetitive tasks have never been a favorite of mine.
In this chapter, we will cover the following:
- What a source generator is
- How to get started with source generators
- Community projects
The idea for this chapter is for you to use it as a reference so that you can implement a new project on your own.