Use Case

MockHero vs Bogus (.NET): Which Should C# Developers Use?

TL;DR

Bogus is great for in-memory fake objects in xUnit/NUnit tests. MockHero is the better choice when you need a big relational dataset for EF Core migrations, staging environments, or demos.

Seeding EF Core with MockHero

using var http = new HttpClient();
http.DefaultRequestHeaders.Add("x-api-key", Env.Get("MOCKHERO_API_KEY"));

var body = new {
  tables = new object[] {
    new { name = "Customers", count = 100, fields = new object[] {
      new { name = "Id", type = "uuid" },
      new { name = "Email", type = "email" }
    }},
    new { name = "Orders", count = 500, fields = new object[] {
      new { name = "Id", type = "uuid" },
      new { name = "CustomerId", type = "ref", @ref = "Customers.Id" },
      new { name = "Total", type = "price" }
    }}
  }
};

var res = await http.PostAsJsonAsync(
  "https://api.mockhero.dev/api/v1/generate", body);
var data = await res.Content.ReadFromJsonAsync<JsonDocument>();

Why MockHero Scales Better

  • Relational integrity out of the box via ref fields.
  • SQL output — ship INSERT statements straight into SQL Server.
  • Shared datasets — every developer and every CI run seeds the same realistic 10,000-row database with a seed parameter.

When Bogus Still Wins

  • Per-test in-memory fakes inside unit tests.
  • Tight, offline feedback loops where network calls are unwanted.

Get Started

Grab a free API key and wire MockHero into your EF Core seeder.

M

MockHero Team

Guides and tutorials for generating realistic test data with the MockHero API.

Start generating test data for free

1,000 rows/month on the free tier. No credit card required.

Get Your API Key

Related Articles