markjprice / apps-services-net8

Repository for the Packt Publishing book titled "Apps and Services with .NET 8" by Mark J. Price
109 stars 51 forks source link

Incorrect code: Chapter 1A - What's New in Modern C# and .NET -> Using declarations #16

Closed gelverpl closed 6 months ago

gelverpl commented 6 months ago

It looks like there is a mistake in the second block of the code in this online section: image

You probably forgot to remove the brackets and it should look like this:

using FileStream file = File.OpenWrite(Path.Combine(path, "file.txt"));
...
// automatically calls Dispose at the end of current scope if the file is not null
markjprice commented 6 months ago

Yes, thank you. Fixed now.