AutoBogus icon indicating copy to clipboard operation
AutoBogus copied to clipboard

Feature: skipping members should also work for inherited interfaces

Open ArnaudB88 opened this issue 2 years ago • 0 comments

I want to request a feature which allows you to declare members to skip of an interface. When a class inherits from that interface, the specified members to skip will also affect the class.

Code:

//Skip members by interface
AutoFaker.Configure(builder =>
{
  builder.WithSkip<IEntityBase>(x => x.CreatedBy);
}

//Instead of by class:
AutoFaker.Configure(builder =>
{
  builder
    .WithSkip<EntityFoo>(x => x.CreatedBy)
    .WithSkip<EntityBar>(x => x.CreatedBy)
    .WithSkip<EntityOther>(x => x.CreatedBy);
}

I will submit a PR for this

ArnaudB88 avatar Nov 03 '22 11:11 ArnaudB88