Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
B

Bogus

> 数据库
Open source

:card_index: A simple fake data generator for C#, F#, and VB.NET. Based on and ported from the famed faker.js.

9.7K stars0 likes0 views
WebsiteGitHub

About

:card_index: A simple fake data generator for C#, F#, and VB.NET. Based on and ported from the famed faker.js.

Bogus for .NET: C#, F#, and VB.NET

Project Description

Hello. I'm your host Brian Chavez (twitter). Bogus is a simple fake data generator for .NET languages like C#, F# and VB.NET. Bogus is fundamentally a C# port of faker.js and inspired by FluentValidation's syntax sugar.

Bogus will help you load databases, UI and apps with fake data for your testing needs. If you like Bogus star :star: the repository and show your friends! :smile: If you find Bogus useful consider supporting the project by purchasing a Bogus Premium license that gives you extra Bogus superpowers! :dizzy: :muscle: You can also sponsor the project here! :moneybag: :dollar:

Download & Install

Nuget Package Bogus

powershell
Install-Package Bogus

Minimum Requirements: .NET Standard 1.3 or .NET Standard 2.0 or .NET Framework 4.0.

Projects That Use Bogus
  • Bitwarden Passwordless Server [code]
  • Elasticsearch .NET Client (NEST) [code]
  • FluentValidation [code]
  • Microsoft Windows-XAML / Template10 [code]
  • Microsoft Learning / Cloud-Native Applications Using Microsoft Azure Cosmos DB [code]
  • Microsoft Office Developer
    • Office 365 Development Training Content [code]
    • Microsoft Teams Sample Connector [code]
Featured In
  • Amazon AWS .NET Open Source Fund Recipient - Oct. 1st, 2024
  • Microsoft 'On .NET Live': Next-level EF Core Data Seeding with Bogus - Apr. 15th, 2024
  • Adventures in .NET: Building Bogus with Brian Chavez - Jan 5th, 2024
  • Microsoft Docs: Deploy Orleans to Azure App Service - May 5th, 2022
  • Microsoft Docs: Modernize a WPF app tutorial - Aug. 2nd, 2019
  • Microsoft Build 2018: Azure Tips and Tricks - May 8th, 2018
  • NuGet Must Haves: Top 10 Unit Testing Libraries in 2017
  • .NET Rocks Podcast: #BetterKnowThatFramework - Mar. 16th 2017, Sep. 13th, 2018, and May 7th, 2020
  • .NET Engineering Blog: NuGet Package of the week #1. - "This week in .NET - December 8th 2015"
Blog Posts
  • Nick Chapsas - Generating realistic fake data in .NET using Bogus [YouTube]
  • Jack Histon - How to Create Bogus Data in C#
  • Christos Matskas - Creating .NET fakes using Bogus
  • Jason Roberts - Lifelike Test Data Generation with Bogus
  • Mark Timmings - Auto generating test data with Bogus
  • .NET Core Generating Test Data
  • Steve Leigh - Seedy Fake Users
  • Volkan Paksoy - Generating Test Data with Bogus
  • Alican Demirtas - Bogus on F#
  • Khalid Abuhakmeh - Seed Entity Framework Core With Bogus
  • Sander ten Brinke - Taking Entity Framework Core data seeding to the next level with Bogus
The Crypto Tip Jar!

Usage

The Great C# Example

…

More Examples!

Language Description
C# Full working example of 'The Great C# Example'
C# Using Bogus and EF Core to a seed database
C# Extending Bogus with custom APIs and data
F# Using Bogus with F#
VB.NET Using Bogus with VB.NET

Locales

Since we're a port of faker.js, we support a whole bunch of different locales. Here's an example in Korean:

csharp
[Test]
public void With_Korean_Locale()
{
    var lorem = new Bogus.DataSets.Lorem(locale: "ko");
    Console.WriteLine(lorem.Sentence(5));
}

/* 국가는 무상으로 행위로 의무를 구성하지 신체의 처벌받지 예술가의 경우와 */

Bogus supports the following locales:

Locale Code Language Locale Code Language
af_ZA Afrikaans fr_CH French (Switzerland)
ar Arabic ge Georgian
az Azerbaijani hr Hrvatski
cz Czech id_ID Indonesia
de German it Italian
de_AT German (Austria) ja Japanese
de_CH German (Switzerland) ko Korean
el Greek lv Latvian
en English nb_NO Norwegian
en_AU English (Australia) ne Nepalese
en_AU_ocker English (Australia Ocker) nl Dutch
en_BORK English (Bork) nl_BE Dutch (Belgium)
en_CA English (Canada) pl Polish
en_GB English (Great Britain) pt_BR Portuguese (Brazil)
en_IE English (Ireland) pt_PT Portuguese (Portugal)
en_IND English (India) ro Romanian
en_NG Nigeria (English) ru Russian
en_US English (United States) sk Slovakian
en_ZA English (South Africa) sv Swedish
es Spanish tr Turkish
es_MX Spanish (Mexico) uk Ukrainian
fa Farsi vi Vietnamese
fi Finnish zh_CN Chinese
fr French zh_TW Chinese (Taiwan)
fr_CA French (Canada) zu_ZA Zulu (South Africa)

Note: Some locales may not have a complete data set. For example, zh_CN does not have a lorem data set, but ko has a lorem data set. Bogus will default to en if a locale-specific data set is not found. To further illustrate the previous example, the missing zh_CN:lorem data set will default to the en:lorem data set.

If you'd like to help contribute new locales or update existing ones please see our Creating Locales wiki page for more info.

Without Fluent Syntax

You can use Bogus without a fluent setup. The examples below highlight three alternative ways to use Bogus without a fluent syntax setup.

  • Using the Faker facade.
  • Using DataSets directly.
  • Using Faker<T> inheritance.

Using the Faker facade:

csharp
public void Using_The_Faker_Facade()
{
   var faker = new Faker("en");
   var o = new Order()
       {
           OrderId = faker.Random.Number(1, 100),
           Item = faker.Lorem.Sentence(),
           Quantity = faker.Random.Number(1, 10)
       };
   o.Dump();
}

Using DataSets directly:

csharp
public void Using_DataSets_Directly()
{
   var random = new Bogus.Randomizer();
   var lorem = new Bogus.DataSets.Lorem("en");
   var o = new Order()
       {
           OrderId = random.Number(1, 100),
           Item = lorem.Sentence(),
           Quantity = random.Number(1, 10)
       };
   o.Dump();
}

Using Faker<T> inheritance:

csharp
public class OrderFaker : Faker<Order> {
   public OrderFaker() {
      RuleFor(o => o.OrderId, f => f.Random.Number(1, 100));
      RuleFor(o => o.Item, f => f.Lorem.Sentence());
      RuleFor(o => o.Quantity, f => f.Random.Number(1, 10));
   }
}

public void Using_FakerT_Inheritance()
{
   var orderFaker = new OrderFaker();
   var o = orderFaker.Generate();
   o.Dump();
}

In the examples above, all three alternative styles of using Bogus produce the same Order result:

{
  "OrderId": 61,
  "Item": "vel e

Issues· 91 open

View all issuesOpen on GitHub
  • #516

    Update Denmark (da) locale from faker-js

    enhancementfuturedataset-updateUpdated Aug 25, 2026
  • #612

    DateTimeReference is null

    Updated Aug 6, 2026
  • #636

    The AutoBogus mentioned in Amazing Community Extensions is abandoned

    Updated Jun 11, 2026
  • #554

    Passing parameters to Faker

    enhancementfutureUpdated Jun 11, 2026
  • #628

    Add Romania vehicle registration plates

    Updated May 26, 2026
  • #634

    Adds support for cnpj alphanumeric values

    Updated Mar 27, 2026
  • #632

    CodiceFiscale generator is not deterministic

    Updated Mar 17, 2026
  • #631

    Multithreaded Generation not working as expected

    Updated Mar 6, 2026
  • #627

    Include Copyright information in the NuGet feed

    Updated Jan 6, 2026
  • #623

    A list of subjects

    Updated Oct 27, 2025

> Tags

C#bogusc-sharpcsharpdata

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 29, 2026
Category数据库
PricingOpen source

> Related tools

P
PostgreSQL
功能强大的开源关系型数据库
R
Redis
内存数据结构存储,常用作缓存与队列
M
MySQL
广泛使用的开源关系型数据库