Chapter 5: Working with Snippets
IntelliSense code snippets, or simply snippets for short, provide a way for developers to quickly insert customizable fragments of text (that is, code or comments) into project files. The use of snippets accelerates the creation of boilerplate code for things such as property creation, try/catch blocks, switch statements, and looping structures. Although snippets are usually designed for small needs such as adding a single property or method, they can also be used to insert entire classes.
In this chapter, we'll look at out-of-the-box snippets and then dissect a custom snippet. Once we demystify them, you will see how easy it is to make and import your own creations. We hope this chapter inspires you to think beyond the basics provided by default in Visual Studio.
In this chapter, you will learn how to do the following:
- Use the code snippets available out of the box
- Customize an existing code snippet to create a Web API method...