Lets say that I have a list of objects like so:
public class FlatModel
{
public string groupName { get; set; }
public decimal value1 { get; set; }
public decimal value2 { get; set; }
public decimal value3 { get; set; }
}
and I want to map them to the following object, by grouping based on GroupName
public class GroupedModel
{
public string groupName { get; set; }
public List<ModelValues> values { get; set; }
}
public class ModelValues
{
public decimal value1 { get; set; }
public decimal value2 { get; set; }
public decimal value3 { get; set; }
}
Is there a straight-forward way to do this using Automapper, Value Injector, or some other object mapping utility?