Skip to content

Commit a26b993

Browse files
authored
Merge pull request #7075 from dotnet/main
Merge main into live
2 parents 0f5d437 + 68a2785 commit a26b993

File tree

5 files changed

+14
-17
lines changed

5 files changed

+14
-17
lines changed

.github/workflows/markdownlint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
steps:
1717
- uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 #@v2
1818
- name: Use Node.js
19-
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 #@v1
19+
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 #@v1
2020
with:
2121
node-version: 12.x
2222
- name: Run Markdownlint

.github/workflows/snippets5000.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
6363
# Update build output json file
6464
- name: Upload build results
65-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 #@v4.6.2
65+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 #@v5.0.0
6666
with:
6767
name: build
6868
path: ./output.json

csharp/getting-started/console-webapiclient/Program.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using System.Net.Http.Headers;
2-
using System.Text.Json;
2+
using System.Net.Http.Json;
33

44
using HttpClient client = new();
55
client.DefaultRequestHeaders.Accept.Clear();
@@ -22,9 +22,6 @@
2222

2323
static async Task<List<Repository>> ProcessRepositoriesAsync(HttpClient client)
2424
{
25-
await using Stream stream =
26-
await client.GetStreamAsync("https://api.github.com/orgs/dotnet/repos");
27-
var repositories =
28-
await JsonSerializer.DeserializeAsync<List<Repository>>(stream);
29-
return repositories ?? new();
25+
var repositories = await client.GetFromJsonAsync<List<Repository>>("https://api.github.com/orgs/dotnet/repos");
26+
return repositories ?? new List<Repository>();
3027
}
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
using System;
2-
using System.Text.Json.Serialization;
1+
using System.Text.Json.Serialization;
32

4-
public sealed record class Repository(
5-
[property: JsonPropertyName("name")] string Name,
6-
[property: JsonPropertyName("description")] string Description,
3+
public record class Repository(
4+
string Name,
5+
string Description,
76
[property: JsonPropertyName("html_url")] Uri GitHubHomeUrl,
8-
[property: JsonPropertyName("homepage")] Uri Homepage,
9-
[property: JsonPropertyName("watchers")] int Watchers,
10-
[property: JsonPropertyName("pushed_at")] DateTime LastPushUtc)
7+
Uri Homepage,
8+
int Watchers,
9+
[property: JsonPropertyName("pushed_at")] DateTime LastPushUtc
10+
)
1111
{
1212
public DateTime LastPush => LastPushUtc.ToLocalTime();
1313
}

csharp/getting-started/console-webapiclient/webapiclient.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net6.0</TargetFramework>
5+
<TargetFramework>net9.0</TargetFramework>
66
<Nullable>enable</Nullable>
77
<ImplicitUsings>enable</ImplicitUsings>
88
</PropertyGroup>

0 commit comments

Comments
 (0)