I am facing a challenge with AutoMapper between my source object and destination object. I will try to explain the sittuation. On my src object I have an string that according to its lenght it should be mapped to multiple properties of my destination object.
class source
{
public int Id {get; set;}
/* some other properties */
public string Value {get; set;}
}
class destination
{
public int Id {get; set;}
/* some other properties with the same name as the source */
public string Value1 {get; set;}
public string Value2 {get; set;}
public string Value3 {get; set;}
}
The max length expected is 30 chars (It can be less than that which will be mapped to only two properties or one). So every 10 will be mapped to each destination property. I was trying to use the ResolveUsing method from AutoMapper but there is no way to let the function to know which segment I should bring back. So I was thinking to ignore the mapping of this properties and do this manually after Automapper has dones its job with other properties