Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding STJ Polymorphism to Result Types #46008

Merged
merged 33 commits into from
Feb 1, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
2143f21
Adding STJ Polymorphism to Result Types
brunolins16 Jan 9, 2023
0c87d13
Merge remote-tracking branch 'upstream/main' into brunolins16/issues/…
brunolins16 Jan 10, 2023
1e048d3
Renaming unittest
brunolins16 Jan 10, 2023
7485673
Adding unit tests
brunolins16 Jan 10, 2023
af1eba8
Adding more unit tests
brunolins16 Jan 10, 2023
84e1c77
Merge remote-tracking branch 'upstream/main' into brunolins16/issues/…
brunolins16 Jan 12, 2023
4a63010
Setting DefaultTypeInfoResolver
brunolins16 Jan 12, 2023
543c338
Merge remote-tracking branch 'upstream/main' into brunolins16/issues/…
brunolins16 Jan 12, 2023
cfbe2fd
Removing ISTrimmable
brunolins16 Jan 12, 2023
8c10b8c
Removing cache
brunolins16 Jan 12, 2023
cabe9c5
Merge remote-tracking branch 'upstream/main' into brunolins16/issues/…
brunolins16 Jan 13, 2023
a4229b3
Clean up
brunolins16 Jan 13, 2023
2be89fc
Avoiding multiple GetTypeInfo calls
brunolins16 Jan 17, 2023
c9ddbea
Merge remote-tracking branch 'upstream/main' into brunolins16/issues/…
brunolins16 Jan 17, 2023
8c09b97
Fixing JsonResult
brunolins16 Jan 18, 2023
52c3b9d
Clean up
brunolins16 Jan 19, 2023
3d7a9f9
clean up
brunolins16 Jan 20, 2023
891d909
Adding Json apis proposal
brunolins16 Jan 20, 2023
1fb0405
Merge remote-tracking branch 'upstream/main' into brunolins16/issues/…
brunolins16 Jan 20, 2023
e854667
Removing name change
brunolins16 Jan 25, 2023
990498c
Merge remote-tracking branch 'upstream/main' into brunolins16/issues/…
brunolins16 Jan 25, 2023
a2a972a
Fixing bad merge
brunolins16 Jan 25, 2023
ae9c2a4
Merge remote-tracking branch 'upstream/main' into brunolins16/issues/…
brunolins16 Jan 27, 2023
c2768f4
Fix build
brunolins16 Jan 27, 2023
610c7b1
PR review
brunolins16 Jan 27, 2023
1930364
PR Feedback
brunolins16 Jan 27, 2023
3b54e1a
Update for the approved API
brunolins16 Jan 30, 2023
205c6c6
PR review
brunolins16 Jan 31, 2023
fba0039
Update TypedResultsTests.cs
brunolins16 Jan 31, 2023
e39d168
Changing IsPolymorphicSafe
brunolins16 Feb 1, 2023
baf9036
Merge remote-tracking branch 'upstream/main' into brunolins16/issues/…
brunolins16 Feb 1, 2023
9df633e
Fixing notnull annotation
brunolins16 Feb 1, 2023
a070575
Remove blank line
brunolins16 Feb 1, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Adding STJ Polymorphism to Result Types
  • Loading branch information
brunolins16 committed Jan 9, 2023
commit 2143f21b8c77ba5f4d2a223c222b566a3c183825
2 changes: 1 addition & 1 deletion src/Http/Http.Results/src/Accepted.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public Task ExecuteAsync(HttpContext httpContext)
httpContext.Response.Headers.Location = Location;
}

HttpResultsHelper.Log.WritingResultAsStatusCode(logger, StatusCode);
HttpResultsWriter.Log.WritingResultAsStatusCode(logger, StatusCode);
httpContext.Response.StatusCode = StatusCode;

return Task.CompletedTask;
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Http.Results/src/AcceptedAtRoute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public Task ExecuteAsync(HttpContext httpContext)

httpContext.Response.Headers.Location = url;

HttpResultsHelper.Log.WritingResultAsStatusCode(logger, StatusCode);
HttpResultsWriter.Log.WritingResultAsStatusCode(logger, StatusCode);
httpContext.Response.StatusCode = StatusCode;

return Task.CompletedTask;
Expand Down
6 changes: 3 additions & 3 deletions src/Http/Http.Results/src/AcceptedAtRouteOfT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ internal AcceptedAtRoute(
Value = value;
RouteName = routeName;
RouteValues = new RouteValueDictionary(routeValues);
HttpResultsHelper.ApplyProblemDetailsDefaultsIfNeeded(Value, StatusCode);
HttpResultsWriter.ApplyProblemDetailsDefaultsIfNeeded(Value, StatusCode);
}

/// <summary>
Expand Down Expand Up @@ -94,10 +94,10 @@ public Task ExecuteAsync(HttpContext httpContext)

httpContext.Response.Headers.Location = url;

HttpResultsHelper.Log.WritingResultAsStatusCode(logger, StatusCode);
HttpResultsWriter.Log.WritingResultAsStatusCode(logger, StatusCode);
httpContext.Response.StatusCode = StatusCode;

return HttpResultsHelper.WriteResultAsJsonAsync(httpContext, logger, Value);
return HttpResultsWriter.WriteResultAsJsonAsync(httpContext, logger, Value);
}

/// <inheritdoc/>
Expand Down
8 changes: 4 additions & 4 deletions src/Http/Http.Results/src/AcceptedOfT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ internal Accepted(string? location, TValue? value)
{
Value = value;
Location = location;
HttpResultsHelper.ApplyProblemDetailsDefaultsIfNeeded(Value, StatusCode);
HttpResultsWriter.ApplyProblemDetailsDefaultsIfNeeded(Value, StatusCode);
}

/// <summary>
Expand All @@ -38,7 +38,7 @@ internal Accepted(string? location, TValue? value)
internal Accepted(Uri locationUri, TValue? value)
{
Value = value;
HttpResultsHelper.ApplyProblemDetailsDefaultsIfNeeded(Value, StatusCode);
HttpResultsWriter.ApplyProblemDetailsDefaultsIfNeeded(Value, StatusCode);

if (locationUri == null)
{
Expand Down Expand Up @@ -88,10 +88,10 @@ public Task ExecuteAsync(HttpContext httpContext)
var loggerFactory = httpContext.RequestServices.GetRequiredService<ILoggerFactory>();
var logger = loggerFactory.CreateLogger("Microsoft.AspNetCore.Http.Result.AcceptedResult");

HttpResultsHelper.Log.WritingResultAsStatusCode(logger, StatusCode);
HttpResultsWriter.Log.WritingResultAsStatusCode(logger, StatusCode);
httpContext.Response.StatusCode = StatusCode;

return HttpResultsHelper.WriteResultAsJsonAsync(
return HttpResultsWriter.WriteResultAsJsonAsync(
httpContext,
logger,
Value);
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Http.Results/src/BadRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public Task ExecuteAsync(HttpContext httpContext)
var loggerFactory = httpContext.RequestServices.GetRequiredService<ILoggerFactory>();
var logger = loggerFactory.CreateLogger("Microsoft.AspNetCore.Http.Result.BadRequestObjectResult");

HttpResultsHelper.Log.WritingResultAsStatusCode(logger, StatusCode);
HttpResultsWriter.Log.WritingResultAsStatusCode(logger, StatusCode);
httpContext.Response.StatusCode = StatusCode;

return Task.CompletedTask;
Expand Down
6 changes: 3 additions & 3 deletions src/Http/Http.Results/src/BadRequestOfT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public sealed class BadRequest<TValue> : IResult, IEndpointMetadataProvider, ISt
internal BadRequest(TValue? error)
{
Value = error;
HttpResultsHelper.ApplyProblemDetailsDefaultsIfNeeded(Value, StatusCode);
HttpResultsWriter.ApplyProblemDetailsDefaultsIfNeeded(Value, StatusCode);
}

/// <summary>
Expand All @@ -50,10 +50,10 @@ public Task ExecuteAsync(HttpContext httpContext)
var loggerFactory = httpContext.RequestServices.GetRequiredService<ILoggerFactory>();
var logger = loggerFactory.CreateLogger("Microsoft.AspNetCore.Http.Result.BadRequestObjectResult");

HttpResultsHelper.Log.WritingResultAsStatusCode(logger, StatusCode);
HttpResultsWriter.Log.WritingResultAsStatusCode(logger, StatusCode);
httpContext.Response.StatusCode = StatusCode;

return HttpResultsHelper.WriteResultAsJsonAsync(
return HttpResultsWriter.WriteResultAsJsonAsync(
httpContext,
logger: logger,
Value);
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Http.Results/src/Conflict.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public Task ExecuteAsync(HttpContext httpContext)
var loggerFactory = httpContext.RequestServices.GetRequiredService<ILoggerFactory>();
var logger = loggerFactory.CreateLogger("Microsoft.AspNetCore.Http.Result.ConflictObjectResult");

HttpResultsHelper.Log.WritingResultAsStatusCode(logger, StatusCode);
HttpResultsWriter.Log.WritingResultAsStatusCode(logger, StatusCode);
httpContext.Response.StatusCode = StatusCode;

return Task.CompletedTask;
Expand Down
6 changes: 3 additions & 3 deletions src/Http/Http.Results/src/ConflictOfT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public sealed class Conflict<TValue> : IResult, IEndpointMetadataProvider, IStat
internal Conflict(TValue? error)
{
Value = error;
HttpResultsHelper.ApplyProblemDetailsDefaultsIfNeeded(Value, StatusCode);
HttpResultsWriter.ApplyProblemDetailsDefaultsIfNeeded(Value, StatusCode);
}

/// <summary>
Expand All @@ -50,10 +50,10 @@ public Task ExecuteAsync(HttpContext httpContext)
var loggerFactory = httpContext.RequestServices.GetRequiredService<ILoggerFactory>();
var logger = loggerFactory.CreateLogger("Microsoft.AspNetCore.Http.Result.ConflictObjectResult");

HttpResultsHelper.Log.WritingResultAsStatusCode(logger, StatusCode);
HttpResultsWriter.Log.WritingResultAsStatusCode(logger, StatusCode);
httpContext.Response.StatusCode = StatusCode;

return HttpResultsHelper.WriteResultAsJsonAsync(
return HttpResultsWriter.WriteResultAsJsonAsync(
httpContext,
logger: logger,
Value);
Expand Down
4 changes: 2 additions & 2 deletions src/Http/Http.Results/src/ContentHttpResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ public Task ExecuteAsync(HttpContext httpContext)

if (StatusCode is { } statusCode)
{
HttpResultsHelper.Log.WritingResultAsStatusCode(logger, statusCode);
HttpResultsWriter.Log.WritingResultAsStatusCode(logger, statusCode);
httpContext.Response.StatusCode = statusCode;
}

return HttpResultsHelper.WriteResultAsContentAsync(
return HttpResultsWriter.WriteResultAsContentAsync(
httpContext,
logger,
ResponseContent,
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Http.Results/src/Created.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public Task ExecuteAsync(HttpContext httpContext)
httpContext.Response.Headers.Location = Location;
}

HttpResultsHelper.Log.WritingResultAsStatusCode(logger, StatusCode);
HttpResultsWriter.Log.WritingResultAsStatusCode(logger, StatusCode);
httpContext.Response.StatusCode = StatusCode;

return Task.CompletedTask;
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Http.Results/src/CreatedAtRoute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public Task ExecuteAsync(HttpContext httpContext)

httpContext.Response.Headers.Location = url;

HttpResultsHelper.Log.WritingResultAsStatusCode(logger, StatusCode);
HttpResultsWriter.Log.WritingResultAsStatusCode(logger, StatusCode);
httpContext.Response.StatusCode = StatusCode;

return Task.CompletedTask;
Expand Down
6 changes: 3 additions & 3 deletions src/Http/Http.Results/src/CreatedAtRouteOfT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ internal CreatedAtRoute(
Value = value;
RouteName = routeName;
RouteValues = new RouteValueDictionary(routeValues);
HttpResultsHelper.ApplyProblemDetailsDefaultsIfNeeded(Value, StatusCode);
HttpResultsWriter.ApplyProblemDetailsDefaultsIfNeeded(Value, StatusCode);
}

/// <summary>
Expand Down Expand Up @@ -94,10 +94,10 @@ public Task ExecuteAsync(HttpContext httpContext)

httpContext.Response.Headers.Location = url;

HttpResultsHelper.Log.WritingResultAsStatusCode(logger, StatusCode);
HttpResultsWriter.Log.WritingResultAsStatusCode(logger, StatusCode);
httpContext.Response.StatusCode = StatusCode;

return HttpResultsHelper.WriteResultAsJsonAsync(
return HttpResultsWriter.WriteResultAsJsonAsync(
httpContext,
logger,
Value);
Expand Down
8 changes: 4 additions & 4 deletions src/Http/Http.Results/src/CreatedOfT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ internal Created(string? location, TValue? value)
{
Value = value;
Location = location;
HttpResultsHelper.ApplyProblemDetailsDefaultsIfNeeded(Value, StatusCode);
HttpResultsWriter.ApplyProblemDetailsDefaultsIfNeeded(Value, StatusCode);
}

/// <summary>
Expand All @@ -38,7 +38,7 @@ internal Created(string? location, TValue? value)
internal Created(Uri? locationUri, TValue? value)
{
Value = value;
HttpResultsHelper.ApplyProblemDetailsDefaultsIfNeeded(Value, StatusCode);
HttpResultsWriter.ApplyProblemDetailsDefaultsIfNeeded(Value, StatusCode);

if (locationUri != null)
{
Expand Down Expand Up @@ -84,10 +84,10 @@ public Task ExecuteAsync(HttpContext httpContext)
var loggerFactory = httpContext.RequestServices.GetRequiredService<ILoggerFactory>();
var logger = loggerFactory.CreateLogger("Microsoft.AspNetCore.Http.Result.CreatedResult");

HttpResultsHelper.Log.WritingResultAsStatusCode(logger, StatusCode);
HttpResultsWriter.Log.WritingResultAsStatusCode(logger, StatusCode);
httpContext.Response.StatusCode = StatusCode;

return HttpResultsHelper.WriteResultAsJsonAsync(
return HttpResultsWriter.WriteResultAsJsonAsync(
httpContext,
logger,
Value);
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Http.Results/src/FileContentHttpResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public Task ExecuteAsync(HttpContext httpContext)
var loggerFactory = httpContext.RequestServices.GetRequiredService<ILoggerFactory>();
var logger = loggerFactory.CreateLogger("Microsoft.AspNetCore.Http.Result.FileContentResult");

var (range, rangeLength, completed) = HttpResultsHelper.WriteResultAsFileCore(
var (range, rangeLength, completed) = HttpResultsWriter.WriteResultAsFileCore(
httpContext,
logger,
FileDownloadName,
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Http.Results/src/FileStreamHttpResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public async Task ExecuteAsync(HttpContext httpContext)

await using (FileStream)
{
var (range, rangeLength, completed) = HttpResultsHelper.WriteResultAsFileCore(
var (range, rangeLength, completed) = HttpResultsWriter.WriteResultAsFileCore(
httpContext,
logger,
FileDownloadName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,23 @@

using System.Text;
using System.Text.Json;
using System.Text.Json.Serialization.Metadata;
using Microsoft.AspNetCore.Http.Json;
using Microsoft.AspNetCore.Internal;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Microsoft.Net.Http.Headers;

namespace Microsoft.AspNetCore.Http;

internal static partial class HttpResultsHelper
internal static partial class HttpResultsWriter
{
internal const string DefaultContentType = "text/plain; charset=utf-8";
private static readonly Encoding DefaultEncoding = Encoding.UTF8;
private static JsonSerializerOptions? _defaultSerializerOptions;
private readonly static object _syncObj = new();

public static Task WriteResultAsJsonAsync<T>(
HttpContext httpContext,
Expand All @@ -27,32 +33,45 @@ public static Task WriteResultAsJsonAsync<T>(
return Task.CompletedTask;
}

var declaredType = typeof(T);
if (declaredType.IsValueType)
{
Log.WritingResultAsJson(logger, declaredType.Name);
jsonSerializerOptions ??= GetDefaultOptions(httpContext);

var declaredTypeInfo = (JsonTypeInfo<T>)jsonSerializerOptions.GetTypeInfo(typeof(T));
if (value is null || declaredTypeInfo.IsPolymorphicSafe())
{
// In this case the polymorphism is not
// relevant and we don't need to box.
return httpContext.Response.WriteAsJsonAsync(
value,
options: jsonSerializerOptions,
contentType: contentType);
value,
declaredTypeInfo,
contentType: contentType);
}

var runtimeType = value.GetType();

Log.WritingResultAsJson(logger, runtimeType.Name);

// Call WriteAsJsonAsync() with the runtime type to serialize the runtime type rather than the declared type
// and avoid source generators issues.
// https://github.com/dotnet/aspnetcore/issues/43894
// https://docs.microsoft.com/en-us/dotnet/standard/serialization/system-text-json-polymorphism

var jsonTypeInfo = jsonSerializerOptions.GetTypeInfo(value.GetType());
Log.WritingResultAsJson(logger, jsonTypeInfo.Type.Name);

return httpContext.Response.WriteAsJsonAsync(
value,
runtimeType,
options: jsonSerializerOptions,
jsonTypeInfo,
contentType: contentType);

static JsonSerializerOptions GetDefaultOptions(HttpContext httpContext)
{
if (_defaultSerializerOptions != null)
{
return _defaultSerializerOptions;
}

// TODO: Should I lock it???
lock (_syncObj)
{
return _defaultSerializerOptions = httpContext.RequestServices.GetService<IOptions<JsonOptions>>()?.Value.SerializerOptions ?? new JsonOptions().SerializerOptions;
}
}
}

public static Task WriteResultAsContentAsync(
Expand Down
4 changes: 2 additions & 2 deletions src/Http/Http.Results/src/JsonHttpResultOfT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ public Task ExecuteAsync(HttpContext httpContext)

if (StatusCode is { } statusCode)
{
HttpResultsHelper.Log.WritingResultAsStatusCode(logger, statusCode);
HttpResultsWriter.Log.WritingResultAsStatusCode(logger, statusCode);
httpContext.Response.StatusCode = statusCode;
}

return HttpResultsHelper.WriteResultAsJsonAsync(
return HttpResultsWriter.WriteResultAsJsonAsync(
httpContext,
logger,
Value,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<Compile Include="$(SharedSourceRoot)ProblemDetails\ProblemDetailsDefaults.cs" LinkBase="Shared" />
<Compile Include="$(SharedSourceRoot)ApiExplorerTypes\*.cs" LinkBase="Shared" />
<Compile Include="$(SharedSourceRoot)RoutingMetadata\AcceptsMetadata.cs" LinkBase="Shared" />
<Compile Include="$(SharedSourceRoot)Json\JsonSerializerExtensions.cs" LinkBase="Shared"/>
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Http.Results/src/NoContent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public Task ExecuteAsync(HttpContext httpContext)
var loggerFactory = httpContext.RequestServices.GetRequiredService<ILoggerFactory>();
var logger = loggerFactory.CreateLogger("Microsoft.AspNetCore.Http.Result.NoContentResult");

HttpResultsHelper.Log.WritingResultAsStatusCode(logger, StatusCode);
HttpResultsWriter.Log.WritingResultAsStatusCode(logger, StatusCode);

httpContext.Response.StatusCode = StatusCode;

Expand Down
2 changes: 1 addition & 1 deletion src/Http/Http.Results/src/NotFound.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public Task ExecuteAsync(HttpContext httpContext)
var loggerFactory = httpContext.RequestServices.GetRequiredService<ILoggerFactory>();
var logger = loggerFactory.CreateLogger("Microsoft.AspNetCore.Http.Result.NotFoundObjectResult");

HttpResultsHelper.Log.WritingResultAsStatusCode(logger, StatusCode);
HttpResultsWriter.Log.WritingResultAsStatusCode(logger, StatusCode);
httpContext.Response.StatusCode = StatusCode;

return Task.CompletedTask;
Expand Down
6 changes: 3 additions & 3 deletions src/Http/Http.Results/src/NotFoundOfT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public sealed class NotFound<TValue> : IResult, IEndpointMetadataProvider, IStat
internal NotFound(TValue? value)
{
Value = value;
HttpResultsHelper.ApplyProblemDetailsDefaultsIfNeeded(Value, StatusCode);
HttpResultsWriter.ApplyProblemDetailsDefaultsIfNeeded(Value, StatusCode);
}

/// <summary>
Expand All @@ -49,10 +49,10 @@ public Task ExecuteAsync(HttpContext httpContext)
var loggerFactory = httpContext.RequestServices.GetRequiredService<ILoggerFactory>();
var logger = loggerFactory.CreateLogger("Microsoft.AspNetCore.Http.Result.NotFoundObjectResult");

HttpResultsHelper.Log.WritingResultAsStatusCode(logger, StatusCode);
HttpResultsWriter.Log.WritingResultAsStatusCode(logger, StatusCode);
httpContext.Response.StatusCode = StatusCode;

return HttpResultsHelper.WriteResultAsJsonAsync(
return HttpResultsWriter.WriteResultAsJsonAsync(
httpContext,
logger: logger,
Value);
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Http.Results/src/Ok.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public Task ExecuteAsync(HttpContext httpContext)
var loggerFactory = httpContext.RequestServices.GetRequiredService<ILoggerFactory>();
var logger = loggerFactory.CreateLogger("Microsoft.AspNetCore.Http.Result.OkObjectResult");

HttpResultsHelper.Log.WritingResultAsStatusCode(logger, StatusCode);
HttpResultsWriter.Log.WritingResultAsStatusCode(logger, StatusCode);
httpContext.Response.StatusCode = StatusCode;

return Task.CompletedTask;
Expand Down
Loading