Skip to content

Add IgnoringSourceProperties()/IgnoringTargetProperties() #4

Description

@floyd-may

There needs to be a way to easily ignore multiple properties; this kind of thing is noisy:

var mapper = FluentMapper
    .ThatMaps<Thing>().From<OtherThing>()
    .IgnoringSourceProperty(x => x.Id)
    .IgnoringSourceProperty(x => x.Prop)
    .IgnoringSourceProperty(x => x.YetAnotherProp)
    .IgnoringSourceProperty(x => x.Properronius)
    .IgnoringSourceProperty(x => x.MoarDataz)
    .IgnoringSourceProperty(x => x.GetThePictureYet)
    .Create();

Should be able to use an anonymous type like so:

var mapper = FluentMapper
    .ThatMaps<Thing>().From<OtherThing>()
    .IgnoringSourceProperties(x => new {
        x.Id,
        x.Prop,
        x.YetAnotherProp,
        x.Properronius,
        x.MoarDataz,
        x.GetThePictureYet,
    })
    .Create();

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