Method Add
- Namespace
- IntentSharp.Mapping
- Assembly
- IntentSharp.dll
Add<TArg, TResult>(string, string, Func<TArg, TResult>)
Registers a converter of one argument: a step reads one source as TArg and writes the result.
public MappingConverterRegistry Add<TArg, TResult>(string name, string version, Func<TArg, TResult> convert)
Parameters
namestringThe name a step uses; unique in the registry, ignoring case.
versionstringThe converter's version; change it when the converter's meaning changes.
convertFunc<TArg, TResult>The conversion. It is not called for a null source.
Returns
- MappingConverterRegistry
This registry, for chaining.
Type Parameters
TArgThe argument type: a string, a number, bool, a date or time, Guid, Uri, an enum, an object or a list of these.
TResultThe result type, of the same kinds.
Exceptions
- ArgumentNullException
convertis null.- ArgumentException
The name or version is null, empty or white space, the name is registered already, or a type is not one a mapping can read or write.
Add<TArg1, TArg2, TResult>(string, string, Func<TArg1, TArg2, TResult>)
Registers a converter of two arguments: a step reads two sources, in order, as TArg1 and TArg2.
public MappingConverterRegistry Add<TArg1, TArg2, TResult>(string name, string version, Func<TArg1, TArg2, TResult> convert)
Parameters
namestringThe name a step uses; unique in the registry, ignoring case.
versionstringThe converter's version; change it when the converter's meaning changes.
convertFunc<TArg1, TArg2, TResult>The conversion. It is not called when either source is null.
Returns
- MappingConverterRegistry
This registry, for chaining.
Type Parameters
TArg1The first argument type.
TArg2The second argument type.
TResultThe result type.
Exceptions
- ArgumentNullException
convertis null.- ArgumentException
The name or version is null, empty or white space, the name is registered already, or a type is not one a mapping can read or write.