AutoMapper and HashSets as properties in TSource, TDestination?

Up vote 0 down vote favorite share g+ share fb share tw.

I have the following classes: public class TaskCenterPath { public TaskCenterPath() { PathOptions = TaskCenterPathOptions. None; Categories = new TaskCenterCategorySet(); Tags = new TaskCenterTagSet(); Subsidiaries = new TaskCenterSubsidiarySet(); } public Guid PathID { get; set; } public TaskCenterPathType PathType { get; set; } public string Path { get; set; } public TaskCenterPathOptions PathOptions { get; set; } public TaskCenterCategorySet Categories { get; set; } public TaskCenterTagSet Tags { get; set; } public TaskCenterSubsidiarySet Subsidiaries { get; set; } } Here's my declaration of TaskCenterSubsidiarySet: public class TaskCenterSubsidiarySet : HashSet { } Both the source and target classes are identical, the only difference is the namespace they are in. I've set up maps (some elided for brevity, I assure you that all the others are there): Mapper.CreateMap(); Mapper.CreateMap(); Mapper.CreateMap(); Mapper.CreateMap(); Mapper.CreateMap(); Mapper.CreateMap(); When mapping between a CRCTC.

TaskCenterPath and a TaskCenterPath, all the "regular" properties are populated (the Guid, custom enum, etc.) However, the HashSet collection paths come back empty. I've used AutoMapper before with collections as class properties with no issue. HashSets look like they're supported, according to here: https://github.com/AutoMapper/AutoMapper/issues/133 I've tried this by compiling from source, but each time I try to map my entities back and forth, anything that's a HashSet comes back empty.

// p is a List return Mapper. Map, List>(p); Is it something I'm doing wrong in CreateMap? In my Mapper.

Map call? Automapper link|improve this question edited Nov 14 '11 at 14:54 asked Nov 12 '11 at 1:23Nicolas Webb738513 100% accept rate.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions