Compono.BogusOptions
Compono.Bogus¶
Compono¶
BogusOptions Class¶
Configuration for BogusMemberNameProvider, set via CompositionBuilderExtensions.UseBogus(Action{BogusOptions}). See docs/adr/0027-compono-bogus-package-design.md and docs/adr/0028-configurable-bogus-member-name-conventions.md.
Inheritance System.Object → BogusOptions
| Properties | |
|---|---|
| EnableMemberNameConventions | Whether the conservative member-name convention provider is active. Defaults to true. Setting this to false means BogusMemberNameProvider is not registered at all - including any AddAlias(string, BogusConvention)/AddConvention(string, Func<Faker,string>) entries configured in the same call; there is no partial mode that disables only the built-in conventions. |
| Locale | The Bogus locale used by the package-wide member-name convention provider (BogusMemberNameProvider) only. UseBogus<T>() is independent of this option and does not read it - it defaults to "en" on its own, or takes an explicit locale parameter. Defaults to Bogus's own default ("en"). |
| Methods | |
|---|---|
| AddAlias(string, BogusConvention) | Adds an additional exact member name that resolves to the same generator as a built-in BogusConvention - e.g. AddAlias("GivenName", BogusConvention.FirstName) lets a domain that calls first names "GivenName" still get realistic values from UseBogus() alone. Validated and applied eagerly, immediately, against this BogusOptions instance's own accumulated state - not deferred to UseBogus(...) returning, and not detected across separate UseBogus(...) calls. |
| AddConvention(string, Func<Faker,string>) | Adds a custom exact-name convention: a member named exactly memberName resolves to generate's result, called against a request-local, context.DeriveSeed()-seeded Bogus.Faker - the same determinism contract every other value in this package follows. Validated and applied eagerly, immediately, against this BogusOptions instance's own accumulated state - not deferred to UseBogus(...) returning, and not detected across separate UseBogus(...) calls. |