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?

有帮助吗?

解决方案

EmitMapper cannot do this task without significant code changes.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top