Skip to content

ShouldBeEquivalentTo: exclude a property of all of a list items #500

@drauch

Description

@drauch

Current state of the art:

Maybe far-fetched, but you may even decide to exclude a member on a particular nested object by its index.

 orderDto.ShouldBeEquivalentTo(order, options => options.Excluding(o => o.Products[1].Status)); 

It would be nice to be able to exclude Status for all items in the list. One could use a special index instead for that, e.g., something along the lines of:

orderDto.ShouldBeEquivalentTo(order, options => options.Excluding(o => o.Products[Something.AllItems].Status));

This would be much better than the current workaround (using PropertyPath), as it is refactoring-safe.

Best regards,
D.R.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions