Class TransformActionExtensions
public static class TransformActionExtensions
- Inheritance
-
TransformActionExtensions
- Inherited Members
Methods
TransformRequest(IConfigureActionBuilder, Func<TransformContext, IBodyReader, Task<BodyContent?>>)
Transform the request body using a function that takes the transform context and the original content as a string and returns the new content as a string.
public static IConfigureFilterBuilder TransformRequest(this IConfigureActionBuilder builder, Func<TransformContext, IBodyReader, Task<BodyContent?>> transformFunction)
Parameters
builderIConfigureActionBuilderThe IConfigureActionBuilder object.
transformFunctionFunc<TransformContext, IBodyReader, Task<BodyContent>>A transformation function that shall return BodyContent or null if no change is made
Returns
- IConfigureFilterBuilder
The IConfigureFilterBuilder object.
TransformRequest(IConfigureActionBuilder, Func<TransformContext, string, Task<string>>)
Transform the request body using a function that takes the transform context and the original content as a string and returns the new content as a string.
public static IConfigureFilterBuilder TransformRequest(this IConfigureActionBuilder builder, Func<TransformContext, string, Task<string>> transformFunction)
Parameters
builderIConfigureActionBuilderThe IConfigureActionBuilder object.
transformFunctionFunc<TransformContext, string, Task<string>>
Returns
TransformResponse(IConfigureActionBuilder, Func<TransformContext, IBodyReader, Task<BodyContent?>>)
Transform the response body using a function that takes the transform context and the original content as a string and returns the new content as a string.
public static IConfigureFilterBuilder TransformResponse(this IConfigureActionBuilder builder, Func<TransformContext, IBodyReader, Task<BodyContent?>> transformFunction)
Parameters
builderIConfigureActionBuilderThe IConfigureActionBuilder object.
transformFunctionFunc<TransformContext, IBodyReader, Task<BodyContent>>A transformation function that shall return BodyContent or null if no change is made
Returns
- IConfigureFilterBuilder
The IConfigureFilterBuilder object.
TransformResponse(IConfigureActionBuilder, Func<TransformContext, Stream, Task<Stream?>>)
Transform the response body using a function that takes the transform context and the original content as a string and returns the new content as a string.
public static IConfigureFilterBuilder TransformResponse(this IConfigureActionBuilder builder, Func<TransformContext, Stream, Task<Stream?>> transformFunction)
Parameters
builderIConfigureActionBuilderThe IConfigureActionBuilder object.
transformFunctionFunc<TransformContext, Stream, Task<Stream>>Function that takes the transform context and the original stream and returns the new content as stream, return null to avoid making changes
Returns
- IConfigureFilterBuilder
The IConfigureFilterBuilder object.
TransformResponse(IConfigureActionBuilder, Func<TransformContext, string, Task<string>>)
Transform the response body using a function that takes the transform context and the original content as a string and returns the new content as a string. This overload consumes the original stream directly.
public static IConfigureFilterBuilder TransformResponse(this IConfigureActionBuilder builder, Func<TransformContext, string, Task<string>> transformFunction)
Parameters
builderIConfigureActionBuilderThe IConfigureActionBuilder object.
transformFunctionFunc<TransformContext, string, Task<string>>Function that takes the transform context and the original content as a string and returns the new content as a string, return null to avoid making changes
Returns
- IConfigureFilterBuilder
The IConfigureFilterBuilder object.