Another handy tool that I like to use is the Quick Action tool. Appearing as a screwdriver , a lightbulb
, or an error light bulb
on a line of code, quick actions enable you to use a single command that will generate code, refactor code, suppress warnings, perform code fixes, and add using statements.
Since the CH10_AddressingCrossCuttingConcerns project had 32 warnings and 13 messages, we can use this project to see the quick actions in action. Have a look at the following screenshot:
![](https://static.packt-cdn.com/products/9781838982973/graphics/assets/edbf7964-0014-4776-bd6c-5f535045eb67.png)
Looking at the preceding screenshot, we see the lightbulb on line 10. If we click on the lightbulb, the following menu pops up:
![](https://static.packt-cdn.com/products/9781838982973/graphics/assets/022c0406-d6cc-41eb-abaf-27bd8f8fe633.png)
If we click on Add readonly modifier, the readonly access modifier is placed after the private access modifier. Have a go yourself at using quick actions to modify the code. It is fairly straightforward once you get the hang of it. Once you have had a play around with...