Forged is a fast, strict, and strongly-typed data generator for C#. Powered by Roslyn Source Generators, it createsDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/atulin/forged/llms.txt
Use this file to discover all available pages before exploring further.
Faker<T> classes at compile time from your models — so you get IntelliSense, compile-time errors for missing required properties, and zero reflection overhead.
Quickstart
Get fake data flowing in under five minutes with a complete working example.
Installation
Add Forged to your project via NuGet and configure the source generator.
Core Concepts
Understand how the
[Fake] attribute, Forge, and generators fit together.API Reference
Browse every built-in generator module and extension method with signatures.
Why Forged?
Most faker libraries rely on reflection and convention-based property matching. Forged takes a different approach: the C# compiler generates your faker class at build time, and it mirrors your model’s property requirements exactly.Compile-Time Safety
If a model property is
required, the generated faker makes its generator required too — you cannot call new PersonFaker() without providing all required fields.No Reflection
Everything is generated as plain C# code. Fully compatible with Native AOT and trimming — no runtime type inspection needed.
Fluent Pipeline API
Chain modifiers like
.Capitalize(), .OrNull(0.2f), .List(3, 5), and .Refine(x => ...) to compose rich generation pipelines.Deterministic Output
Pass a seeded
Random instance to reproduce the exact same dataset every run — perfect for snapshot tests.Quick Example
ProductFaker. Configure it and generate data:
Install the NuGet package
Add
Atulin.Forged to your project. The package bundles both the runtime library and the source generator.Configure the generated faker
Instantiate the generated
{Model}Faker, providing a generator lambda for each property.