mirror of
https://github.com/markjprice/cs11dotnet7.git
synced 2026-04-07 07:14:02 +00:00
Initial commit
This commit is contained in:
parent
bc96ccb183
commit
18f89e91d4
62 changed files with 1661 additions and 2 deletions
19
vscode/Chapter06/PeopleApp/Program.Helpers.cs
Normal file
19
vscode/Chapter06/PeopleApp/Program.Helpers.cs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
using Packt.Shared;
|
||||
|
||||
partial class Program
|
||||
{
|
||||
static void OutputPeopleNames(IEnumerable<Person?> people, string title)
|
||||
{
|
||||
WriteLine(title);
|
||||
foreach (Person? p in people)
|
||||
{
|
||||
WriteLine(" {0}",
|
||||
p is null ? "<null> Person" : p.Name ?? "<null> Name");
|
||||
|
||||
|
||||
/* if p is null then output: <null> Person
|
||||
else output: p.Name
|
||||
unless p.Name is null in which case output: <null> Name */
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue