HttpContextExtensions Class
HAKOM.Serialization.Http.Net.Api.Extensions
Section titled “HAKOM.Serialization.Http.Net.Api.Extensions”Provides extension methods for Microsoft.AspNetCore.Http.HttpContext related to serialization and query parameter binding.
public static class HttpContextExtensionsInheritance System.Object 🡒 HttpContextExtensions
Methods
Section titled “Methods”HttpContextExtensions.SetSerializer(this HttpContext, ISerializer) Method
Section titled “HttpContextExtensions.SetSerializer(this HttpContext, ISerializer) Method”Stores the specified serializer in the Microsoft.AspNetCore.Http.HttpContext.Items dictionary for use during the current request.
public static void SetSerializer(this Microsoft.AspNetCore.Http.HttpContext httpContext, HAKOM.Serialization.Core.Net.Api.ISerializer serializer);Parameters
Section titled “Parameters”httpContext Microsoft.AspNetCore.Http.HttpContext
The Microsoft.AspNetCore.Http.HttpContext to store the serializer in.
serializer ISerializer
The ISerializer instance to associate with the request.
HttpContextExtensions.TryGetQueryParametersBoundForParameter(this HttpContext, ParameterDescriptor, IEnumerable<string>) Method
Section titled “HttpContextExtensions.TryGetQueryParametersBoundForParameter(this HttpContext, ParameterDescriptor, IEnumerable<string>) Method”Attempts to retrieve the query parameter names that were bound for the specified parameterDescriptor.
public static bool TryGetQueryParametersBoundForParameter(this Microsoft.AspNetCore.Http.HttpContext httpContext, Microsoft.AspNetCore.Mvc.Abstractions.ParameterDescriptor parameterDescriptor, out System.Collections.Generic.IEnumerable<string> boundParameters);Parameters
Section titled “Parameters”httpContext Microsoft.AspNetCore.Http.HttpContext
The Microsoft.AspNetCore.Http.HttpContext to retrieve the bound parameters from.
parameterDescriptor Microsoft.AspNetCore.Mvc.Abstractions.ParameterDescriptor
The Microsoft.AspNetCore.Mvc.Abstractions.ParameterDescriptor identifying the action parameter.
boundParameters System.Collections.Generic.IEnumerable<System.String>
When this method returns true, contains the bound query parameter names.
Returns
Section titled “Returns”System.Boolean
true if bound query parameters were found for the parameter; otherwise, false.
HttpContextExtensions.TryGetSerializer(this HttpContext, ISerializer) Method
Section titled “HttpContextExtensions.TryGetSerializer(this HttpContext, ISerializer) Method”Attempts to retrieve the ISerializer previously stored in the Microsoft.AspNetCore.Http.HttpContext.Items dictionary.
public static bool TryGetSerializer(this Microsoft.AspNetCore.Http.HttpContext httpContext, out HAKOM.Serialization.Core.Net.Api.ISerializer serializer);Parameters
Section titled “Parameters”httpContext Microsoft.AspNetCore.Http.HttpContext
The Microsoft.AspNetCore.Http.HttpContext to retrieve the serializer from.
serializer ISerializer
When this method returns true, contains the ISerializer; otherwise, null.
Returns
Section titled “Returns”System.Boolean
true if a serializer was found; otherwise, false.