Method WithMappingConverters
- Namespace
- IntentSharp
- Assembly
- IntentSharp.dll
WithMappingConverters(Action<MappingConverterRegistry>)
Registers the converters the client's compiled mappings may call by name with Convert: your own code for what the closed vocabulary does not express. A stored mapping holds only a converter's name; a name the client does not register refuses the mapping, and a converter that throws fails the step. The registered names and versions are part of every mapping key, so registering a converter, or changing a version, compiles each key once. Calling it again adds to the same registry. Each client built afterwards gets its own copy of the converters registered by then, so a later registration does not change a client already built.
public IntentClientBuilder WithMappingConverters(Action<MappingConverterRegistry> configure)
Parameters
configureAction<MappingConverterRegistry>Registers converters, such as
c => c.Add<decimal, decimal>("celsiusToFahrenheit", "1", t => t * 9 / 5 + 32).
Returns
- IntentClientBuilder
This builder.
Exceptions
- ArgumentNullException
configureis null.