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())));
}
}
- 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.