Examples from Chapter 1 (Introduction) of Programming C# 8.0 (O'Reilly).
The first four examples are all from a solution featuring the standard Hello World example, along with a unit test project.
- Example 1. A unit test class for our first program
- Example 2. Calling a method
- Example 3. Making the program entry point accessible
- Example 4. Program.cs
Examples 6 and 9 also happen to come from this solution.
With Example 10, we make a change to the program to cause the tests to pass. There's a separate solution containing this modified version of this code. (It's identical except for the one change described in Example 10.)
- Example 10. Displaying a message
- Example 11. Test class with attribute
- Example 12. Annotated methods part 1 and part 2
- Example 13. A field
The other examples in this chapter illustrate namespaces and are found in a separate solution.
- Example 5. Resolving ambiguity with aliases
- Example 7. Nesting namespace declarations
- Example 8. Nested namespace with a single declaration
Example 6, and Example 9 through 13 are all in the first example.