Question

I'd like to map from a flattened object to a hierarchical object based on a simple naming convention. For example:

public class FlatObject {
    public string Name__FirstName { get; set; }
    public string Name__MiddleName { get; set; }
    public string Name__LastName { get; set; }
}

public class HierarchicalObject {
    public SubObject Name { get; set; }
}

public class SubObject {
    public string FirstName { get; set; }
    public string MiddleName { get; set; }
    public string LastName { get; set; }
}

The simple naming convention is the double-underscore within the FlattenedObject.

How would I accomplish this using EmitMapper?

Was it helpful?

Solution

EmitMapper cannot do this task without significant code changes.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top