You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 906a374
Browse filesBrowse the repository at this point in the historyBrowse files
JsonObjectsWithHttpClient: net10.0, three-argument StringContent, JsonContent and source-generated samples
- Retarget both projects from net8.0 to net10.0.
- Replace Swashbuckle.AspNetCore 6.4.0 with Microsoft.AspNetCore.OpenApi 10.0.12 (AddOpenApi, MapOpenApi); drop the empty RunConfiguration PropertyGroup; launchUrl now openapi/v1.json.
- Delete the dead AddScoped registration (AddHttpClient registers the typed client).
- PetService: primary constructor, three-argument StringContent, ReadFromJsonAsync on every path, rename PostAsJsonAsync to PostWithPostAsJsonAsync.
- Add PostAsJsonContentAsync (JsonContent.Create plus PostAsync) and PostAsSourceGeneratedJsonAsync (PetContext), with routes /postAsJsonContent and /postAsSourceGeneratedJson.
- Tests: async Task instead of async void (xUnit1048), shared CreateClient helper, a test per service method, and a test pinning the two StringContent constructors' Content-Type values.
- Test packages: Microsoft.NET.Test.Sdk 18.10.1, xunit 2.9.3, xunit.runner.visualstudio 4.0.0, coverlet.collector 10.1.0, Moq 4.20.70 down to 4.18.4 (SponsorLink).
Copy file name to clipboardExpand all lines: dotnet-client-libraries/JsonObjectsWithHttpClient/JsonObjectsWithHttpClient/Properties/launchSettings.json
0 commit comments