Skip to content

Commit 12e919b

Browse files
Merge pull request #49380 from v-thpra/azure-triage-fix-1034576
Fix for Customer Feedback 1034576: Working with files and directories in a .NET application error on drive 9
2 parents bb91a83 + 886b51a commit 12e919b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

learn-pr/language/dotnet-files/includes/9-exercise-read-write-files.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ In this exercise, you complete the project by reading the .json files, adding up
2626
record SalesData (double Total);
2727
```
2828

29-
## Create a method to calculate sales totals
29+
## Create a method that calculates sales totals
3030

3131
1. In `Program.cs`, just before the `record` line that you added in the previous step, create a new function that calculates the sales total. This method should take an `IEnumerable<string>` of file paths that it can iterate over.
3232

@@ -55,7 +55,7 @@ In this exercise, you complete the project by reading the .json files, adding up
5555
string salesJson = File.ReadAllText(file);
5656
5757
// Parse the contents as JSON
58-
SalesData? data = JsonSerializer.Deserialize<SalesData?>(salesJson);
58+
SalesData? data = JsonConvert.DeserializeObject<SalesData?>(salesJson);
5959
6060
// Add the amount found in the Total field to the salesTotal variable
6161
salesTotal += data?.Total ?? 0;
@@ -101,7 +101,7 @@ In this exercise, you complete the project by reading the .json files, adding up
101101
File.AppendAllText(Path.Combine(salesTotalDir, "totals.txt"), $"{salesTotal}{Environment.NewLine}");
102102
```
103103
104-
1. Press <kbd>Ctrl+S</kbd> / <kbd>Cmd+S</kbd> to save the *Program.cs* file.
104+
1. Save the *Program.cs* file by pressing <kbd>Ctrl+S</kbd> / <kbd>Cmd+S</kbd>.
105105
106106
## Run the program
107107
@@ -123,7 +123,7 @@ In this exercise, you complete the project by reading the .json files, adding up
123123

124124
The *totals.txt* file now has a second line. Every time you run the program, the totals are added up again and a new line is written to the file.
125125

126-
Outstanding work! You've written a smart, robust, and handy tool that Tailwind Traders can use to process all of its stores' sales every night. In the next unit, we'll review what you learned and a few tips to remember.
126+
Outstanding work! You wrote a smart, robust, and handy tool that Tailwind Traders can use to process all of its stores' sales every night. In the next unit, we'll review what you learned and a few tips to remember.
127127

128128
## Got stuck?
129129

0 commit comments

Comments
 (0)