From 0a285745140bd45d07871239bcbfa09829dcf273 Mon Sep 17 00:00:00 2001 From: Oli Sturm Date: Thu, 12 May 2022 16:35:34 +0100 Subject: [PATCH] fixes --- samples/CS10/Program.cs | 2 +- samples/CS8/Program.cs | 4 ++-- samples/CS9/Program.cs | 7 +++++++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/samples/CS10/Program.cs b/samples/CS10/Program.cs index e6165b8..c931922 100644 --- a/samples/CS10/Program.cs +++ b/samples/CS10/Program.cs @@ -18,7 +18,7 @@ Address = new Address { City = "Castle Douglas", Country = "UK" } }; if (customer is { Address.City: "Castle Douglas" }) { - Console.WriteLine("Dieser Kunde wohnt gleich um die Ecke"); + Console.WriteLine("This customer lives around the corner"); } } } diff --git a/samples/CS8/Program.cs b/samples/CS8/Program.cs index d462afe..6eb5438 100644 --- a/samples/CS8/Program.cs +++ b/samples/CS8/Program.cs @@ -5,7 +5,7 @@ { 1 => 2, 2 => 3, - _ => throw new ArgumentException("Weiter geht's nicht") + _ => throw new ArgumentException("Rien ne va plus") }; // Property Pattern: @@ -34,7 +34,7 @@ Address = new Address { City = "Castle Douglas", Country = "UK" } }; if (customer is { Address: { City: "Castle Douglas" } }) { - Console.WriteLine("Dieser Kunde wohnt gleich um die Ecke"); + Console.WriteLine("This customer lives around the corner"); } } } diff --git a/samples/CS9/Program.cs b/samples/CS9/Program.cs index 37a9112..619d3d3 100644 --- a/samples/CS9/Program.cs +++ b/samples/CS9/Program.cs @@ -20,6 +20,13 @@ } } + public enum OrderValue { + ValuableDueToHighCount, + ValuableDueToHighItemPrice, + ValuableDueToHighTotal, + NotValuable, + } + // Positional patterns with placeholders - note that // the element lists must be "complete"! static OrderValue OrderValueCategory(Order o) =>