Warnings through Chapter 20
MODIFY
src/Chapter20/Listing20.04.ValueTaskAsyncReturn.cs
src/Chapter20/Listing20.04.ValueTaskAsyncReturn.cs
+using System;
+
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter20.Listing20_04
{
using System.IO;
@@ -17,7 +19,7 @@ namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter20.Listing20_04
new System.IO.Compression.GZipStream(
memoryStream, System.IO.Compression.CompressionMode.Compress);
- await gZipStream.WriteAsync(buffer, 0, buffer.Length);
+ await gZipStream.WriteAsync(buffer.AsMemory(0, buffer.Length));
return memoryStream.ToArray();
}

MODIFY
src/Chapter20/Listing20.12.CustomMethodWithProgressSupport.cs
src/Chapter20/Listing20.12.CustomMethodWithProgressSupport.cs
@@ -10,10 +10,10 @@ namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter20.Listing20_12
static public Task<Process> RunProcessAsync(
string fileName,
string arguments = "",
- CancellationToken cancellationToken =
- default(CancellationToken),
IProgress<ProcessProgressEventArgs>? progress = null,
- object? objectState = null)
+ object? objectState = null,
+ CancellationToken cancellationToken =
+ default(CancellationToken))
{
TaskCompletionSource<Process> taskCS =
new TaskCompletionSource<Process>();

Warnings through Chapter 20