How to map an array to multiple properties using AutoMapper?
- by Dror Helper
I need to map a single fixed sized array array to multiple properties.
For example given this class:
public class Source
{
public int[] ItemArray{get;set} // always 4 items
}
I want to map the array to this class
public class Dest
{
public int Item1{get;set;}
public int Item1{get;set;}
public int Item1{get;set;}
public int Item1{get;set;}
}
Is there a simple way to do it with AutoMapper (without actually mapping each individual field)?