Consider the following classes :
class B{
string FullName;
}
class A{
int Id;
string FirstName;
string LastName;
}
class AContainer{
ICollection<A> aObjects;
}
class BContainer{
IDictionary<int,B> bObjects;
}
the mapping logic :
AContainer aContainer = ...//get somehow
BContainer b = new BContainer{
bObjects = aContainer.aObjects.ToDictionary(a=>a.Id, a=>new B{
FullName = @"{a.FirstName} {a.LastName}" }
)
}
How do I map such collection to keyed dictionary ? (I'm using Mapster.Tool
to generate the interface implementation from the configuration)
Thanks