❔ Mapperly | How to map a property?

How can I automatically map ExampleB when ExampleA getting mapped to InternalExampleA

[Mapper]
public class TestMapper
{
    public partial InternalExampleA ToInternalA(ExampleA data);
    public partial InternalExampleB ToInternalB(ExampleB data);
}

public class ExampleA
{
    public Guid Id { get; set; }
    public ExampleB B { get; set; }
}

public class InternalExampleA
{
    public Guid Id { get; set; }
    public ExampleB B { get; set; }
}

public class ExampleB
{
    public Guid AnotherId { get; set; }
}

public class InternalExampleB
{
    public Guid AnotherId { get; set; }
}
Was this page helpful?