Skip to content

Mapping Property Object Over Target #64

@SlowLogicBoy

Description

@SlowLogicBoy

Is there a better way to do this?:

class Statistics
{
    public float Ranking {get; set;}
    public string SomeOtherRankingStuff {get; set;}
}
class Model
{
   public string SomeOtherProperties {get;set;}
   public Statistics Statistics {get; set;}
}
class ModelDto
{
   public string SomeOtherProperties {get;set;}
   public float Ranking {get; set;}
   public string SomeOtherRankingStuff {get; set;}
}
Mapper.WhenMapping
    .From<Model>()
    .To<ModelDto>()
    .After.MappingEnds
    .Call(ctx => ctx.Source.Statistics.Map().Over(ctx.Target));

I want to map Statistics property Over ModelDto, since it doesn't have a seperate property for statistics?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions