Skip to content

Mapping is not working for the child object #1

@himilmodi

Description

@himilmodi

public class a{
public int Id {get;set;}
public b ObjB{get;set;}
}

public class b{
public string Name {get;set;}
}

When i just tried to map with class A property
.Map(o => o.ObjB.Name, "Name")

then it is throwing below error
Expression 'o => o.ObjB.Name' must resolve to top-level member and not any child object's properties. You can use ForPath, a custom resolver on the child type or the AfterMap option instead. (Parameter 'lambdaExpression')'

Can you guys help me resolved this issue ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions