If I have a class, Foo, looking like this…
class Foo
{
public string TelephoneNumber1;
public string TelephoneNumber2;
public string TelephoneNumber3;
public string TelephoneNumber4;
}
is it possible to use AutoMapper to map to this class…
class Bar
{
public ContactInfo[] Contacts;
}
where ContactInfo is…
class ContactInfo
{
public string TelephoneNumber;
}
if so, how?
Not exactly. You could map a Foo with a string[] of telephone numbers:
Then you could map like so: