Skip to main content
Version: 0.3.x (0.3.0)

Class ValueObjectFunctionsWorkerApplicationBuilderExtensions

Namespace: AdCodicem.ValueObjects.AzureFunctions
Assembly: AdCodicem.ValueObjects.AzureFunctions.dll

Registers the value object converter with the Azure Functions isolated worker.

public static class ValueObjectFunctionsWorkerApplicationBuilderExtensions

Inheritance​

object ← ValueObjectFunctionsWorkerApplicationBuilderExtensions

Inherited Members​

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()

Methods​

UseValueObjects(IFunctionsWorkerApplicationBuilder)​

Puts the value object converter first among the worker's input converters, or right behind the ASP.NET Core integration's own converter when called before ConfigureFunctionsWebApplication(), so that a route value, a query value and other binding data bind to a value object through its TryParse.

public static IFunctionsWorkerApplicationBuilder UseValueObjects(this IFunctionsWorkerApplicationBuilder builder)

Parameters​

builder IFunctionsWorkerApplicationBuilder

The worker's builder: the one FunctionsApplication.CreateBuilder(args) returns, or the one ConfigureFunctionsWebApplication(worker => …) and ConfigureFunctionsWorkerDefaults(worker => …) hand over.

Returns​

IFunctionsWorkerApplicationBuilder

The same builder, so calls can be chained.

Remarks​

The worker tries the converter a parameter or its type names with [InputConverter] first, then those its binding attribute advertises, then the registered ones in order: the value object converter goes first among the last, where it reads only value objects, and only from text. Payloads stay with their bindings and the worker's serializer.

The ASP.NET Core integration puts its own converter first too, from a configuration of its own, which runs after this one when ConfigureFunctionsWebApplication() is called later: the value object converter then comes right behind it. That converter binds an HttpRequest and an HttpRequestData alone, so either order binds the same.

Calling it twice registers the converter once.

Exceptions​

ArgumentNullException

builder is null.