Skip to content

Commit 46b22b5

Browse files
authored
Merge branch 'dotnet:main' into main
2 parents a1d7d2a + 5d0e0d0 commit 46b22b5

File tree

49 files changed

+1918
-795
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1918
-795
lines changed

.github/workflows/backport.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ permissions:
1414

1515
jobs:
1616
backport:
17-
uses: dotnet/arcade/.github/workflows/backport-base.yml@e2fed65f9c524d12c64876194ae4ce177b935bb3 # 2025-01-13
17+
uses: dotnet/arcade/.github/workflows/backport-base.yml@40693ae2ee51e447f6ca96d07bc1ba779dcb9b9c # 2025-01-13
1818
with:
1919
pr_description_template: |
2020
Backport of #%source_pr_number% to %target_branch%

.github/workflows/inter-branch-merge-flow.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ permissions:
1010

1111
jobs:
1212
Merge:
13-
uses: dotnet/arcade/.github/workflows/backport-base.yml@e2fed65f9c524d12c64876194ae4ce177b935bb3 # 2024-06-24
13+
uses: dotnet/arcade/.github/workflows/backport-base.yml@40693ae2ee51e447f6ca96d07bc1ba779dcb9b9c # 2024-06-24

eng/Version.Details.xml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -402,25 +402,25 @@
402402
<Uri>https://github.com/dotnet/extensions</Uri>
403403
<Sha>3f10dd4d52002f1d83435f7ca791b77fea1718e6</Sha>
404404
</Dependency>
405-
<Dependency Name="optimization.windows_nt-x64.MIBC.Runtime" Version="1.0.0-prerelease.25364.1">
405+
<Dependency Name="optimization.windows_nt-x64.MIBC.Runtime" Version="1.0.0-prerelease.25374.3">
406406
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-optimization</Uri>
407-
<Sha>c79fe70760b7052d414b125a5916c014c8724d61</Sha>
407+
<Sha>19381a50e687f98b824327a282f973f4de52f26b</Sha>
408408
</Dependency>
409-
<Dependency Name="optimization.windows_nt-x86.MIBC.Runtime" Version="1.0.0-prerelease.25364.1">
409+
<Dependency Name="optimization.windows_nt-x86.MIBC.Runtime" Version="1.0.0-prerelease.25374.3">
410410
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-optimization</Uri>
411-
<Sha>c79fe70760b7052d414b125a5916c014c8724d61</Sha>
411+
<Sha>19381a50e687f98b824327a282f973f4de52f26b</Sha>
412412
</Dependency>
413-
<Dependency Name="optimization.linux-x64.MIBC.Runtime" Version="1.0.0-prerelease.25364.1">
413+
<Dependency Name="optimization.linux-x64.MIBC.Runtime" Version="1.0.0-prerelease.25374.3">
414414
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-optimization</Uri>
415-
<Sha>c79fe70760b7052d414b125a5916c014c8724d61</Sha>
415+
<Sha>19381a50e687f98b824327a282f973f4de52f26b</Sha>
416416
</Dependency>
417-
<Dependency Name="optimization.windows_nt-arm64.MIBC.Runtime" Version="1.0.0-prerelease.25364.1">
417+
<Dependency Name="optimization.windows_nt-arm64.MIBC.Runtime" Version="1.0.0-prerelease.25374.3">
418418
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-optimization</Uri>
419-
<Sha>c79fe70760b7052d414b125a5916c014c8724d61</Sha>
419+
<Sha>19381a50e687f98b824327a282f973f4de52f26b</Sha>
420420
</Dependency>
421-
<Dependency Name="optimization.linux-arm64.MIBC.Runtime" Version="1.0.0-prerelease.25364.1">
421+
<Dependency Name="optimization.linux-arm64.MIBC.Runtime" Version="1.0.0-prerelease.25374.3">
422422
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-optimization</Uri>
423-
<Sha>c79fe70760b7052d414b125a5916c014c8724d61</Sha>
423+
<Sha>19381a50e687f98b824327a282f973f4de52f26b</Sha>
424424
</Dependency>
425425
<!-- Dependencies required for source build to lift to the previously-source-built version. -->
426426
<!-- These versions are manually updated -->

eng/Versions.props

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,11 @@
163163
<!-- Packages from dotnet/xdt -->
164164
<MicrosoftWebXdtVersion>3.2.0-preview.25377.103</MicrosoftWebXdtVersion>
165165
<!-- dotnet-optimization dependencies -->
166-
<optimizationwindows_ntx64MIBCRuntimeVersion>1.0.0-prerelease.25364.1</optimizationwindows_ntx64MIBCRuntimeVersion>
167-
<optimizationwindows_ntx86MIBCRuntimeVersion>1.0.0-prerelease.25364.1</optimizationwindows_ntx86MIBCRuntimeVersion>
168-
<optimizationwindows_ntarm64MIBCRuntimeVersion>1.0.0-prerelease.25364.1</optimizationwindows_ntarm64MIBCRuntimeVersion>
169-
<optimizationlinuxx64MIBCRuntimeVersion>1.0.0-prerelease.25364.1</optimizationlinuxx64MIBCRuntimeVersion>
170-
<optimizationlinuxarm64MIBCRuntimeVersion>1.0.0-prerelease.25364.1</optimizationlinuxarm64MIBCRuntimeVersion>
166+
<optimizationwindows_ntx64MIBCRuntimeVersion>1.0.0-prerelease.25374.3</optimizationwindows_ntx64MIBCRuntimeVersion>
167+
<optimizationwindows_ntx86MIBCRuntimeVersion>1.0.0-prerelease.25374.3</optimizationwindows_ntx86MIBCRuntimeVersion>
168+
<optimizationwindows_ntarm64MIBCRuntimeVersion>1.0.0-prerelease.25374.3</optimizationwindows_ntarm64MIBCRuntimeVersion>
169+
<optimizationlinuxx64MIBCRuntimeVersion>1.0.0-prerelease.25374.3</optimizationlinuxx64MIBCRuntimeVersion>
170+
<optimizationlinuxarm64MIBCRuntimeVersion>1.0.0-prerelease.25374.3</optimizationlinuxarm64MIBCRuntimeVersion>
171171
</PropertyGroup>
172172
<!--
173173

src/DataProtection/DataProtection/test/Microsoft.AspNetCore.DataProtection.Tests/HostingTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public async Task WebhostLoadsKeyRingBeforeServerStarts()
2525
.Returns(Mock.Of<IKeyRing>())
2626
.Callback(() => tcs.TrySetResult());
2727

28+
#pragma warning disable ASPDEPR004 // Type or member is obsolete
2829
var builder = new WebHostBuilder()
2930
.UseStartup<TestStartup>()
3031
.ConfigureServices(s =>
@@ -33,6 +34,7 @@ public async Task WebhostLoadsKeyRingBeforeServerStarts()
3334
.Replace(ServiceDescriptor.Singleton(mockKeyRing.Object))
3435
.AddSingleton<IServer>(
3536
new FakeServer(onStart: () => tcs.TrySetException(new InvalidOperationException("Server was started before key ring was initialized")))));
37+
#pragma warning restore ASPDEPR004 // Type or member is obsolete
3638

3739
using (var host = builder.Build())
3840
{

src/DefaultBuilder/src/WebHost.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,9 @@ public static IWebHostBuilder CreateDefaultBuilder() =>
154154
/// <returns>The initialized <see cref="IWebHostBuilder"/>.</returns>
155155
public static IWebHostBuilder CreateDefaultBuilder(string[] args)
156156
{
157+
#pragma warning disable ASPDEPR004 // Type or member is obsolete
157158
var builder = new WebHostBuilder();
159+
#pragma warning restore ASPDEPR004 // Type or member is obsolete
158160

159161
if (string.IsNullOrEmpty(builder.GetSetting(WebHostDefaults.ContentRootKey)))
160162
{

src/Features/JsonPatch.SystemTextJson/src/JsonPatchDocument.cs

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@
33

44
using System;
55
using System.Collections.Generic;
6+
using System.Reflection;
67
using System.Text.Json;
78
using System.Text.Json.Serialization;
9+
using Microsoft.AspNetCore.Builder;
10+
using Microsoft.AspNetCore.Http.Metadata;
811
using Microsoft.AspNetCore.JsonPatch.SystemTextJson.Adapters;
912
using Microsoft.AspNetCore.JsonPatch.SystemTextJson.Converters;
1013
using Microsoft.AspNetCore.JsonPatch.SystemTextJson.Exceptions;
@@ -18,7 +21,7 @@ namespace Microsoft.AspNetCore.JsonPatch.SystemTextJson;
1821
// documents for cases where there's no class/DTO to work on. Typical use case: backend not built in
1922
// .NET or architecture doesn't contain a shared DTO layer.
2023
[JsonConverter(typeof(JsonPatchDocumentConverter))]
21-
public class JsonPatchDocument : IJsonPatchDocument
24+
public class JsonPatchDocument : IJsonPatchDocument, IEndpointParameterMetadataProvider
2225
{
2326
public List<Operation> Operations { get; private set; }
2427

@@ -27,7 +30,7 @@ public class JsonPatchDocument : IJsonPatchDocument
2730

2831
public JsonPatchDocument()
2932
{
30-
Operations = new List<Operation>();
33+
Operations = [];
3134
SerializerOptions = JsonSerializerOptions.Default;
3235
}
3336

@@ -205,17 +208,27 @@ IList<Operation> IJsonPatchDocument.GetOperations()
205208
{
206209
foreach (var op in Operations)
207210
{
208-
var untypedOp = new Operation();
209-
210-
untypedOp.op = op.op;
211-
untypedOp.value = op.value;
212-
untypedOp.path = op.path;
213-
untypedOp.from = op.from;
211+
var untypedOp = new Operation
212+
{
213+
op = op.op,
214+
value = op.value,
215+
path = op.path,
216+
from = op.from
217+
};
214218

215219
allOps.Add(untypedOp);
216220
}
217221
}
218222

219223
return allOps;
220224
}
225+
226+
/// <inheritdoc/>
227+
static void IEndpointParameterMetadataProvider.PopulateMetadata(ParameterInfo parameter, EndpointBuilder builder)
228+
{
229+
ArgumentNullException.ThrowIfNull(parameter);
230+
ArgumentNullException.ThrowIfNull(builder);
231+
232+
builder.Metadata.Add(new AcceptsMetadata(["application/json-patch+json"], parameter.ParameterType));
233+
}
221234
}

src/Features/JsonPatch.SystemTextJson/src/JsonPatchDocumentOfT.cs

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
using System.Reflection;
1010
using System.Text.Json;
1111
using System.Text.Json.Serialization;
12+
using Microsoft.AspNetCore.Builder;
13+
using Microsoft.AspNetCore.Http.Metadata;
1214
using Microsoft.AspNetCore.JsonPatch.SystemTextJson.Adapters;
1315
using Microsoft.AspNetCore.JsonPatch.SystemTextJson.Converters;
1416
using Microsoft.AspNetCore.JsonPatch.SystemTextJson.Exceptions;
@@ -23,7 +25,7 @@ namespace Microsoft.AspNetCore.JsonPatch.SystemTextJson;
2325
// including type data in the JsonPatchDocument serialized as JSON (to allow for correct deserialization) - that's
2426
// not according to RFC 6902, and would thus break cross-platform compatibility.
2527
[JsonConverter(typeof(JsonPatchDocumentConverterFactory))]
26-
public class JsonPatchDocument<TModel> : IJsonPatchDocument where TModel : class
28+
public class JsonPatchDocument<TModel> : IJsonPatchDocument, IEndpointParameterMetadataProvider where TModel : class
2729
{
2830
public List<Operation<TModel>> Operations { get; private set; }
2931

@@ -32,7 +34,7 @@ public class JsonPatchDocument<TModel> : IJsonPatchDocument where TModel : class
3234

3335
public JsonPatchDocument()
3436
{
35-
Operations = new List<Operation<TModel>>();
37+
Operations = [];
3638
SerializerOptions = JsonSerializerOptions.Default;
3739
}
3840

@@ -657,11 +659,20 @@ IList<Operation> IJsonPatchDocument.GetOperations()
657659
return allOps;
658660
}
659661

662+
/// <inheritdoc/>
663+
static void IEndpointParameterMetadataProvider.PopulateMetadata(ParameterInfo parameter, EndpointBuilder builder)
664+
{
665+
ArgumentNullException.ThrowIfNull(parameter);
666+
ArgumentNullException.ThrowIfNull(builder);
667+
668+
builder.Metadata.Add(new AcceptsMetadata(["application/json-patch+json"], typeof(TModel)));
669+
}
670+
660671
// Internal for testing
661672
internal string GetPath<TProp>(Expression<Func<TModel, TProp>> expr, string position)
662673
{
663674
var segments = GetPathSegments(expr.Body);
664-
var path = String.Join("/", segments);
675+
var path = string.Join('/', segments);
665676
if (position != null)
666677
{
667678
path += "/" + position;

src/Features/JsonPatch.SystemTextJson/src/Microsoft.AspNetCore.JsonPatch.SystemTextJson.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
<Compile Include="$(SharedSourceRoot)CallerArgument\CallerArgumentExpressionAttribute.cs" LinkBase="Shared" />
1717
</ItemGroup>
1818

19+
<ItemGroup>
20+
<Reference Include="Microsoft.AspNetCore.Http.Abstractions" />
21+
</ItemGroup>
22+
1923
<ItemGroup>
2024
<InternalsVisibleTo Include="Microsoft.AspNetCore.JsonPatch.SystemTextJson.Tests" />
2125
</ItemGroup>

src/Features/JsonPatch/build.cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
@ECHO OFF
2-
SET RepoRoot=%~dp0..\..
2+
SET RepoRoot=%~dp0..\..\..
33
%RepoRoot%\eng\build.cmd -projects %~dp0**\*.*proj %*

0 commit comments

Comments
 (0)