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
Adding STJ Polymorphism to Result Types (dotnet#46008)
* Adding STJ Polymorphism to Result Types
* Renaming unittest
* Adding unit tests
* Adding more unit tests
* Setting DefaultTypeInfoResolver
* Removing ISTrimmable
* Removing cache
* Clean up
* Avoiding multiple GetTypeInfo calls
* Fixing JsonResult
* Clean up
* clean up
* Adding Json apis proposal
* Removing name change
Removing the change from HttpResultsHelper to HttpResultsWriter to avoid polluting the git with not related changes and I will do it later.
* Fixing bad merge
* Fix build
* PR review
* PR Feedback
* Update for the approved API
* PR review
* Update TypedResultsTests.cs
* Changing IsPolymorphicSafe
* Fixing notnull annotation
// Remove once https://github.com/dotnet/aspnetcore/pull/46008 is done.
20
-
[UnconditionalSuppressMessage("Trimming","IL2026:Members annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code",Justification="<Pending>")]
21
-
[UnconditionalSuppressMessage("AOT","IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute' may break functionality when AOT compiling.",Justification="<Pending>")]
22
-
publicstaticTaskWriteResultAsJsonAsync<T>(
22
+
publicstaticTaskWriteResultAsJsonAsync<TValue>(
23
23
HttpContexthttpContext,
24
24
ILoggerlogger,
25
-
T?value,
25
+
TValue?value,
26
26
string?contentType=null,
27
27
JsonSerializerOptions?jsonSerializerOptions=null)
28
28
{
@@ -31,32 +31,30 @@ public static Task WriteResultAsJsonAsync<T>(
// Licensed to the .NET Foundation under one or more agreements.
2
+
// The .NET Foundation licenses this file to you under the MIT license.
3
+
4
+
namespaceMicrosoft.AspNetCore.Http;
5
+
6
+
internalclassJsonHttpResultTrimmerWarning
7
+
{
8
+
publicconststringSerializationUnreferencedCodeMessage="JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext.";
9
+
publicconststringSerializationRequiresDynamicCodeMessage="JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use the overload that takes a JsonTypeInfo or JsonSerializerContext.";
0 commit comments