I am using Automapper for mapping my domain model and DTO.
When I map Mapper.Map<SiteDTO, SiteEntity> it works fine.
But when I use collections of the same entities, it doesn't map.
Mapper.Map<Collection<SiteEntity>, Collection<SiteDTO>>(siteEntityCollection);
AS per Automapper Wiki, it says the lists implementing ICollection would be mapped, I am using Collection that implements ICollection, but automapper doesn't map it. Am I doing something wrong.
public class SiteEntity //SiteDTO has exactly the same properties, so I am not posting it here.
{
public int SiteID { get; set; }
public string Code { get; set; }
public string Name { get; set; }
public byte Status { get; set; }
public int ModifiedBy { get; set; }
public DateTime ModifiedDate{ get; set; }
public long TimeStamp{ get; set; }
public string Description{ get; set; }
public string Notes{ get; set; }
public ObservableCollection<AreaEntity> Areas{ get; set; }
}