nickdodd79 / AutoBogus

A C# library complementing the Bogus generator by adding auto creation and population capabilities.
MIT License
423 stars 49 forks source link

Feature: add option to only populate simple types #96

Open ArnaudB88 opened 1 year ago

ArnaudB88 commented 1 year ago

I want to request this feature because in our projects we don't want complex type members to be populated. This is the default from the nBuilder github repo from which we are migrating. For faking entity framework entities, we want to manually construct the navigation properties, which are complex types.

This option would allow to specify if only simple type members should be populated like:

        var instance = AutoFaker.Generate<Order>(builder =>
        {
          builder
            .WithOnlySimpleTypes(true);
        });

I will create a PR for this.