tags:

views:

228

answers:

1

I have Article class with property

private IList<Tag> _tags;
public virtual IList<Tag> Tags
{
get{
if(_tags == null)
  _tags = TagService.GetTags(this);
return _tags;
}
}

Since there is no SET for Tags automapper will not set tags when mapping from viewmodel to view. Any ideas?

+1  A: 

Try using the UseDestinationValue option:

ForMember(dest => dest.Tags, opt => opt.UseDestinationValue());

In the latest DLL on the trunk, AutoMapper should pick up readonly list-type members.

Jimmy Bogard

related questions