Skip to content
| Marketplace
Sign in
Visual Studio>Tools>Generate Bogus Fakers
Generate Bogus Fakers

Generate Bogus Fakers

Microlens

|
4 installs
| (0) | Free
Generate Bogus Faker classes directly from C# classes and records in Visual Studio. Generate a single Faker, an entire folder, or a complete project with support for common scalar types, enums, collec
Download

Generate Bogus Fakers

Turn any C# class or record into a ready-to-use Bogus Faker<T> — right from Solution Explorer, with zero configuration required.

What it does

  • Right-click a csharp file → generates a Faker<T> for the class/record in it
  • Right-click a folder → generates Fakers for every eligible class in it
  • Right-click a project → generates Fakers for all the classes in the entire project

Analysis runs on the Roslyn semantic model — not text/regex parsing — so nested types, records, and nullable properties resolve correctly every time.

Supported types out of the box

Category Types
Scalars bool, char, byte, short, int, long, float, double, decimal
Text string
Date/time DateTime, DateTimeOffset
Identifiers Guid
Enums enum
Collections T[], List<T>, HashSet<T>
Maps Dictionary<TKey, TValue>

Nullable value types are unwrapped automatically. Only settable, non-static, non-indexer properties are included.

Convention-based realistic data

Property names are matched against common naming conventions and mapped to realistic generators instead of generic random values:

  • Email → email address
  • FirstName / GivenName, LastName / Surname / FamilyName → real names
  • PhoneNumber / Phone / Mobile → phone numbers
  • UserName / Username, Url / Website → internet data
  • City, Country, PostalCode / ZipCode / Zip → addresses
  • CompanyName / Company → company names

Anything the generator can't confidently map is left as a clearly marked // TODO: comment in the generated file instead of a silent guess, so you always know what needs a manual rule.

Example

public class Customer {
    public string FirstName { get; set; }
    public string Email { get; set; }
    public int Age { get; set; }
    public List<string> Tags { get; set; }
}

generates:

public class CustomerFaker : Faker<Customer> {
    public CustomerFaker() {
        RuleFor(x => x.FirstName, f => f.Name.FirstName());
        RuleFor(x => x.Email, f => f.Internet.Email());
        RuleFor(x => x.Age, f => f.Random.Int());
        RuleFor(x => x.Tags, f => new List<string>(f.Make(3, () => f.Name.FullName())));
    }
}

Configurable (Tools > Options > Microlens Synthesizer)

  • Overwrite Existing Fakers — regenerate in place, or skip when the file already exists
  • Collection Element Count — how many elements to generate for arrays, lists, sets, and dictionaries
  • Faker Class Suffix — customize the generated class name suffix (default Faker)
  • Log File Path & Mode — optional run log (every run, multi-file batches only, skipped/failed only, or failed only)

Generated files are added to your project automatically.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft