bchavez / Bogus

:card_index: A simple fake data generator for C#, F#, and VB.NET. Based on and ported from the famed faker.js.
Other
8.62k stars 491 forks source link

Feature: skipping members should also work for inherited interfaces #448

Closed ArnaudB88 closed 1 year ago

ArnaudB88 commented 1 year ago

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 commented 1 year ago

wrong repo, should've been AutoBogus repo