I am trying to map one entity to another (which has one additional field).
Group {
int Id;
}
GroupExtended {
int Id;
string Description;
}
So I do the mapping in loop:
foreach (var group in groups)
{
var result = mapper.Map<Group, GroupExtended>(group,
opt => opt.AfterMap((src, dest) => dest.Description = someValue));
}
Is that possible to map entire IEnumerable, and still passing an the value ? I tried this:
var result = mapper.Map<List<GroupExtended>>(groups,
opt => opt.AfterMap((src, dest) => dest.Description = someValue));
But it has an error on dest.Description
: 'object' does not contain definition of "Description"