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
Copy file name to clipboardExpand all lines: src/Http/Http.Results/src/HttpResultsHelper.cs
+8Lines changed: 8 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -34,10 +34,14 @@ public static Task WriteResultAsJsonAsync<T>(
34
34
35
35
// In this case the polymorphism is not
36
36
// relevant and we don't need to box.
37
+
#pragma warning disable IL2026// Members annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code
38
+
#pragma warning disable IL3050// Calling members annotated with 'RequiresDynamicCodeAttribute' may break functionality when AOT compiling.
37
39
returnhttpContext.Response.WriteAsJsonAsync(
38
40
value,
39
41
options:jsonSerializerOptions,
40
42
contentType:contentType);
43
+
#pragma warning restore IL3050// Calling members annotated with 'RequiresDynamicCodeAttribute' may break functionality when AOT compiling.
44
+
#pragma warning restore IL2026// Members annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code
41
45
}
42
46
43
47
varruntimeType=value.GetType();
@@ -48,11 +52,15 @@ public static Task WriteResultAsJsonAsync<T>(
#pragma warning disable IL2026// Members annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code
56
+
#pragma warning disable IL3050// Calling members annotated with 'RequiresDynamicCodeAttribute' may break functionality when AOT compiling.
51
57
returnhttpContext.Response.WriteAsJsonAsync(
52
58
value,
53
59
runtimeType,
54
60
options:jsonSerializerOptions,
55
61
contentType:contentType);
62
+
#pragma warning restore IL3050// Calling members annotated with 'RequiresDynamicCodeAttribute' may break functionality when AOT compiling.
63
+
#pragma warning restore IL2026// Members annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code
0 commit comments