Added null conditional operator and null forgiveness operator
MODIFY
src/Chapter05/Listing05.33.CustomParameterValidation.cs
src/Chapter05/Listing05.33.CustomParameterValidation.cs
@@ -40,8 +40,8 @@ private static void DownloadSSL(string httpsUrl, string fileName)
$"{nameof(fileName)} cannot be empty or only whitespace");
}
#else
- ArgumentException.ThrowIfNullOrEmpty(httpsUrl.Trim());
- ArgumentException.ThrowIfNullOrEmpty(fileName?.Trim());
+ ArgumentException.ThrowIfNullOrEmpty(httpsUrl = httpsUrl?.Trim()!);
+ ArgumentException.ThrowIfNullOrEmpty(fileName = fileName?.Trim()!);
#endif
if (!httpsUrl.ToUpper().StartsWith("HTTPS"))

MODIFY
src/Chapter06/Listing06.22.DefiningCalculatedProperties.cs
src/Chapter06/Listing06.22.DefiningCalculatedProperties.cs
@@ -64,7 +64,7 @@ namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter06.Listing06_22
throw new ArgumentException("Value cannot be null, empty or Whitespace");
#else
// #endregion EXCLUDE
- ArgumentException.ThrowIfNullOrEmpty(value.Trim());
+ ArgumentException.ThrowIfNullOrEmpty(value = value?.Trim()!);
// #region EXCLUDE
#endif // NET7_0_OR_GREATER
// #endregion EXCLUDE

Added null conditional operator and null forgiveness operator