LdifDotNet.Generator 0.8.0

dotnet add package LdifDotNet.Generator --version 0.8.0
                    
NuGet\Install-Package LdifDotNet.Generator -Version 0.8.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="LdifDotNet.Generator" Version="0.8.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LdifDotNet.Generator" Version="0.8.0" />
                    
Directory.Packages.props
<PackageReference Include="LdifDotNet.Generator" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add LdifDotNet.Generator --version 0.8.0
                    
#r "nuget: LdifDotNet.Generator, 0.8.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package LdifDotNet.Generator@0.8.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=LdifDotNet.Generator&version=0.8.0
                    
Install as a Cake Addin
#tool nuget:?package=LdifDotNet.Generator&version=0.8.0
                    
Install as a Cake Tool

LdifDotNet.Generator

Deterministic fake LDAP directory data, powered by Bogus. Same seed, same output — always. Generated data is verified loadable into real OpenLDAP in CI.

using LdifDotNet;
using LdifDotNet.Generator;

// A complete loadable tree: base entry, OUs, people, groups
var records = new LdifGenerator(new LdifGeneratorOptions
{
    Seed = 42,
    BaseDn = "dc=example,dc=com",
    PeopleCount = 100,
    GroupCount = 10,
}).SampleDirectory();
LdifWriter.WriteFile("seed.ldif", records);

Schema-driven generation works from real schema files (via LdifDotNet.Schema):

var schema = LdapSchema.Load("core.schema", "cosine.schema", "inetorgperson.schema", "eduperson.schema");
var options = new SchemaGeneratorOptions { Seed = 42, OptionalAttributeFill = 1.0 };
options.AuxiliaryClasses.Add("eduPerson");
options.ExampleValues["eduPersonAffiliation"] = ["faculty", "student", "staff"];
options.Formatters["mail"] = "{{name.firstName}}.{{name.lastName}}@corp.example";
options.Formatters["employeeNumber"] = "EMP-{{randomizer.replacenumbers(#####)}}";
var entries = new SchemaEntryGenerator(schema, options).Entries("inetOrgPerson", 100, "ou=people,dc=example,dc=com");

MUST attributes are always filled; MAY attributes per OptionalAttributeFill; values come from your formatters, then example pools, then well-known-attribute heuristics, then syntax-aware generation.

Formatters templates use Bogus handlebars tokens{{dataset.method(args)}}, case-insensitive; text outside tokens is emitted verbatim (literal {{/}} cannot be expressed — the tokenizer owns them, and its error may quote generated text). A formatter overrides all built-in generation for its attribute and its output is not checked against the attribute's syntax. Tokens must return scalar values and are stringified with the invariant culture; they draw from the generator's seeded randomness (time tokens from a fixed epoch), so seeded output stays deterministic per package version regardless of machine culture. Malformed, non-scalar, and always-empty templates fail construction; the dictionary is snapshotted at construction, and a key naming a schema attribute covers all of its names (surname also formats sn). Empty, whitespace-only, or control-character RDN values fail generation loudly rather than emitting DNs a real server rejects. RDN collisions are resolved by drawing fresh values; only text-safe syntaxes fall back to a -n suffix, and structured syntaxes (e.g. INTEGER) fail rather than emit a corrupted value.

DN-valued attributes

Attributes whose syntax is Distinguished Name (member, owner, seeAlso, manager, ...) are drawn from real DNs rather than filled with the parent DN, so generated membership is something a consumer can actually traverse:

var people = generator.Entries("inetOrgPerson", 100, "ou=people,dc=example,dc=com");
// No wiring needed: DNs already minted by this generator are the default source.
var groups = generator.Entries("groupOfNames", 10, "ou=groups,dc=example,dc=com");

// Or point an attribute at DNs you own:
options.DnPool["member"] = people.Select(p => p.Dn).ToList();
options.MaxDnValues = 8;         // values per multi-valued DN attribute, default 4
options.DanglingMemberRatio = 0.1; // 10% resolve to nothing, for referential-integrity testing

Sources, in order: the attribute's DnPool, then the DNs this generator has already minted, then the parent DN — the last reached only before anything has been minted. Pool values must parse as RFC 4514 DNs or construction fails. SINGLE-VALUE attributes always get exactly one value whatever MaxDnValues says, an entry never references itself, and a dangling DN's RDN value is reserved so no later entry can make the reference resolve. Formatters and ExampleValues still take precedence and stay single-valued.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on LdifDotNet.Generator:

Package Downloads
JoshMakeStuff.Aspire.Hosting.OpenLdap

.NET Aspire hosting integration for OpenLDAP with TLS, seeding, health checks, and a bundled LDAP administration UI.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.8.0 604 8/8/2026
0.7.0 107 8/7/2026
0.6.0 152 8/3/2026
0.5.0 105 7/29/2026
0.3.0 111 7/17/2026
0.2.0 112 7/17/2026
0.1.0 114 7/17/2026