diff --git a/src/Chapter05/Listing05.30.RethrowingAnException.cs b/src/Chapter05/Listing05.30.RethrowingAnException.cs index c8555a349..65bf53add 100644 --- a/src/Chapter05/Listing05.30.RethrowingAnException.cs +++ b/src/Chapter05/Listing05.30.RethrowingAnException.cs @@ -17,7 +17,7 @@ public static void Main() catch (FormatException exception) { Console.WriteLine( - "A FormateException was thrown"); + "A FormatException was thrown"); } #region INCLUDE // ... diff --git a/src/Chapter06/Listing06.06.AccessingFields.cs b/src/Chapter06/Listing06.06.AccessingFields.cs index 7bc5c8a6d..ecf72ac02 100644 --- a/src/Chapter06/Listing06.06.AccessingFields.cs +++ b/src/Chapter06/Listing06.06.AccessingFields.cs @@ -18,10 +18,10 @@ public static void Main() employee1.Salary = "Too Little"; IncreaseSalary(employee1); Console.WriteLine( - "{0} {1}: {2}", - employee1.FirstName, - employee1.LastName, - employee1.Salary); + $"{ + employee1.FirstName } { + employee1.LastName }: { + employee1.Salary }"); #endregion HIGHLIGHT // ... } diff --git a/src/Chapter06/Listing06.39.DisablingRequiredObjectInitialization.cs b/src/Chapter06/Listing06.39.DisablingRequiredObjectInitialization.cs index 883411e6e..6dd35fca7 100644 --- a/src/Chapter06/Listing06.39.DisablingRequiredObjectInitialization.cs +++ b/src/Chapter06/Listing06.39.DisablingRequiredObjectInitialization.cs @@ -41,8 +41,7 @@ public required string Title } set { - ArgumentException.ThrowIfNullOrEmpty( - value = value?.Trim()!); + ArgumentException.ThrowIfNullOrEmpty(value); _Title = value; } } @@ -56,8 +55,7 @@ public required string Isbn } set { - ArgumentException.ThrowIfNullOrEmpty( - value = value?.Trim()!); + ArgumentException.ThrowIfNullOrEmpty(value); _Isbn = value; } }