Skip to content

Commit e6424fc

Browse files
committed
Update for trimming
1 parent bcc2529 commit e6424fc

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/Http/Http.Abstractions/src/Validation/ValidatablePropertyInfo.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ public abstract class ValidatablePropertyInfo
1818
/// </summary>
1919
public ValidatablePropertyInfo(
2020
Type declaringType,
21+
[param: DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties)]
2122
Type propertyType,
2223
string name,
2324
string displayName,

src/Http/Routing/src/ValidationEndpointFilterFactory.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ namespace Microsoft.AspNetCore.Http.Validation;
1111

1212
internal static class ValidationEndpointFilterFactory
1313
{
14+
private const string ValidationContextJustification = "The DisplayName property is always statically initialized in the ValidationContext through this codepath.";
1415

15-
[UnconditionalSuppressMessage("Trimming", "IL2026:Members annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code", Justification = "<Pending>")]
16+
[UnconditionalSuppressMessage("Trimming", "IL2026:Members annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code", Justification = ValidationContextJustification)]
1617
public static EndpointFilterDelegate Create(EndpointFilterFactoryContext context, EndpointFilterDelegate next)
1718
{
1819
var parameters = context.MethodInfo.GetParameters();

0 commit comments

Comments
 (0)