Skip to content
Documentation

OutputFormatterWriteContextExtensions Class

Provides extension methods for Microsoft.AspNetCore.Mvc.Formatters.OutputFormatterWriteContext related to response serialization.

public static class OutputFormatterWriteContextExtensions

Inheritance System.Object 🡒 OutputFormatterWriteContextExtensions

OutputFormatterWriteContextExtensions.TrySerialize(this OutputFormatterWriteContext) Method

Section titled “OutputFormatterWriteContextExtensions.TrySerialize(this OutputFormatterWriteContext) Method”

Serializes the context’s object to the response body using the ISerializer stored in the HttpContext.

public static System.Threading.Tasks.Task<bool> TrySerialize(this Microsoft.AspNetCore.Mvc.Formatters.OutputFormatterWriteContext context);

context Microsoft.AspNetCore.Mvc.Formatters.OutputFormatterWriteContext

The Microsoft.AspNetCore.Mvc.Formatters.OutputFormatterWriteContext for the current response.

System.Threading.Tasks.Task<System.Boolean>
true if serialization succeeded; otherwise, false.

OutputFormatterWriteContextExtensions.TrySerialize(this OutputFormatterWriteContext, object) Method

Section titled “OutputFormatterWriteContextExtensions.TrySerialize(this OutputFormatterWriteContext, object) Method”

Serializes the specified value to the response body using the ISerializer stored in the HttpContext.

public static System.Threading.Tasks.Task<bool> TrySerialize(this Microsoft.AspNetCore.Mvc.Formatters.OutputFormatterWriteContext context, object? value);

context Microsoft.AspNetCore.Mvc.Formatters.OutputFormatterWriteContext

The Microsoft.AspNetCore.Mvc.Formatters.OutputFormatterWriteContext for the current response.

value System.Object

The object to serialize. May be null.

System.Threading.Tasks.Task<System.Boolean>
true if serialization succeeded; otherwise, false.

© 2026 Volue.Version v0.6.38017 November 2026