DAG
DAG

Reputation: 2630

EmitMapper and ValueInjecter with IList

I'm running a performance test for AutoMapper, FasMapper, ValueInjecter and EmitMapper and I'm facing problem only with EmitMapper and ValueInjecter when I try to map list of types IList<T>

That's the code I user for all mappers:

adapter.Adapt<IList<VacationModel>, IList<VacationDto>>(source));

That is my adapter implementation for EmitMapper:

    public TTarget Adapt<TSource, TTarget>(TSource source)
    {
        return ObjectMapperManager.DefaultInstance.GetMapper<TSource, TTarget>().Map(source);
    }

That is for ValueInjecter:

    public TTarget Adapt<TSource, TTarget>(TSource source)
    {
        return Mapper.Map<TSource, TTarget>(source);
    }

I have a single interface that holds the method Adapt<TSource, TTarget>(TSource source)

What am I doning wrong? It's working for AutoMapper and FastMapper tho! If I change to List<T> it works for all mappers.

Upvotes: 1

Views: 296

Answers (0)

Related Questions