OutputFormatterWriteContextExtensions Class
HAKOM.Serialization.Http.Net.Api.Extensions
Section titled “HAKOM.Serialization.Http.Net.Api.Extensions”Provides extension methods for Microsoft.AspNetCore.Mvc.Formatters.OutputFormatterWriteContext related to response serialization.
public static class OutputFormatterWriteContextExtensionsInheritance System.Object 🡒 OutputFormatterWriteContextExtensions
Methods
Section titled “Methods”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);Parameters
Section titled “Parameters”context Microsoft.AspNetCore.Mvc.Formatters.OutputFormatterWriteContext
The Microsoft.AspNetCore.Mvc.Formatters.OutputFormatterWriteContext for the current response.
Returns
Section titled “Returns”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);Parameters
Section titled “Parameters”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.
Returns
Section titled “Returns”System.Threading.Tasks.Task<System.Boolean>
true if serialization succeeded; otherwise, false.