IValueTransformer

interface IValueTransformer (
T
) {}

Members

Functions

transform
T transform(T value)

Examples

import automapper : MapperConfiguration, CreateMap;

static class A {
    string foo;
}

static class B {
    string foo;
}

static class StringTransformer : IValueTransformer!string
{
    string transform(in string value)
    {
        return value ~ "!!!";
    }
}

auto am = MapperConfiguration!(
    CreateMap!(A, B),
    ValueTransformer!StringTransformer)
        .createMapper();

A a = new A();
const B b = am.map!B(a);
assert(b.foo == "!!!");

Meta