Lyo.Seed 3.0.0

dotnet add package Lyo.Seed --version 3.0.0
                    
NuGet\Install-Package Lyo.Seed -Version 3.0.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="Lyo.Seed" Version="3.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Lyo.Seed" Version="3.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Lyo.Seed" />
                    
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 Lyo.Seed --version 3.0.0
                    
#r "nuget: Lyo.Seed, 3.0.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 Lyo.Seed@3.0.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=Lyo.Seed&version=3.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Lyo.Seed&version=3.0.0
                    
Install as a Cake Tool

Lyo.Seed

A named SeedContributor is run against an ISeedTransport by Lyo.Seed. The graph only wants items (Func<int, T> / ForEach factories). Bogus and other fakers remain in the host. This package ships two transports: EfSeedTransport<TContext> (AddRange + SaveChangesAsync) and ApiSeedTransport (chunked POST {route}/Bulk, skip via POST {route}/QueryConcrete).

Features

  • No generator dependency. Factories that return T go to SeedGraph.Entity and ForEach. Contributors can use Bogus, hand-built objects, or anything else.
  • EF transport. Each batch is persisted by EfSeedTransport<TContext> with SaveChangesAsync. After callbacks may call SeedSession.PersistAsync or use Context for schema-specific deletes.
  • API transport. ApiSeedTransport maps request types onto Lyo.Api routes, chunks at MaxBulkAmount (default 2000), and fails the run when CreateBulkResult.FailedCount > 0.
  • Conflict modes. Append (default), optional SkipIfNotEmpty, and Replace (OnClear is required).
  • EF source. IEfSeedSource names the Postgres schema and opens the DbContext. Hosts that see the interface build EfSeedTransport<T> without a per-contributor switch.

Examples

Contributor on EF

using Lyo.Common.Core.Identifiers;

public sealed class ParentContributor : SeedContributor
{
    public override string Name => "parents";
    public override SeedTransportKind SupportedTransports => SeedTransportKind.Ef;

    protected override void Configure(SeedGraph graph, SeedOptions options)
        => graph.Entity(options.Count, i => new ParentRow { Id = LyoGuid.CreateV7(), Name = $"p-{i}" })
            .ForEach(_ => 2, (parent, i) => new ChildRow { Id = LyoGuid.CreateV7(), ParentId = parent.Id, Label = $"{parent.Name}-{i}" });
}

await using var db = new MyDbContext(options);
var result = await new SeedRunner().SeedAsync(new ParentContributor(), new EfSeedTransport<MyDbContext>(db));

Transport over the API

var catalog = new SeedApiCatalog();
catalog.Map<PersonReq, PersonRes>("Person");
var transport = new ApiSeedTransport(apiClient, catalog);
await runner.SeedAsync(peopleApiContributor, transport, new() { Count = 50 });

Container registration

services.AddLyoSeed();
services.AddSeedContributor<ParentContributor>();
services.AddEfSeedTransport<MyDbContext>();
services.AddApiSeedTransport(api => api.Map<PersonReq, PersonRes>("Person"));

How transports are built

Build EfSeedTransport<TContext> on a live DbContext, or ApiSeedTransport on IApiClient plus a SeedApiCatalog. A contributor that implements IEfSeedSource opens its own context from the connection string (CreateContext) so the host does not switch on contributor type. ISeedRunner rejects a transport whose Kind is missing from SeedContributor.SupportedTransports.

Dependencies

Generated from ProjectReference / PackageReference (same model as docs/Lyo.ProjectGraph.html).

  • Lyo.Api.Client (direct, lyo)
  • Lyo.Api.Models (direct, lyo)
  • Lyo.Exceptions (direct, lyo)
  • Lyo.Http.Client (direct, lyo)
  • Lyo.Query.Models (direct, lyo)
  • Microsoft.EntityFrameworkCore 10.0.5 (direct, microsoft)
  • Microsoft.Extensions.DependencyInjection.Abstractions 10.0.5 (direct, microsoft)
  • Npgsql 10.0.3 (direct, third-party)
  • Lyo.Common.Core (transitive, lyo)
  • Lyo.Common.Metadata (transitive, lyo)
  • Lyo.DateAndTime (transitive, lyo)
  • Lyo.Diagnostic (transitive, lyo)
  • Lyo.Hashing (transitive, lyo)
  • Lyo.Json (transitive, lyo)
  • Lyo.Metrics (transitive, lyo)
  • Lyo.PackageMetadata (transitive, lyo)
  • Lyo.Parameters (transitive, lyo)
  • Lyo.Result (transitive, lyo)
  • AngleSharp 1.5.0 (transitive, third-party)
  • Microsoft.Bcl.AsyncInterfaces 10.0.5 (transitive, microsoft, netstandard2.0)
  • Microsoft.Extensions.Configuration.Binder 10.0.5 (transitive, microsoft)
  • Microsoft.Extensions.Http 10.0.5 (transitive, microsoft)
  • Microsoft.Extensions.Logging.Abstractions 10.0.5 (transitive, microsoft)
  • System.IO.Hashing 10.0.5 (transitive, microsoft, net10.0)
  • System.Memory 4.6.3 (transitive, microsoft, netstandard2.0)
  • System.Text.Encoding.CodePages 10.0.5 (transitive, microsoft)
  • System.Text.Json 10.0.5 (transitive, microsoft, netstandard2.0)
  • System.Threading.RateLimiting 10.0.5 (transitive, microsoft)
  • System.Threading.Tasks.Extensions 4.6.3 (transitive, microsoft)
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 (36)

Showing the top 5 NuGet packages that depend on Lyo.Seed:

Package Downloads
Lyo.Audiobook.Seed

EF seed of audiobook genres, one series, and works with a narrator, an ISBN, and a chapter.

Lyo.Comment.Seed

EF seed of comments on a fixed seed subject.

Lyo.Billing.Seed

EF seed of billing clients, each with one draft invoice and one line.

Lyo.Algorithms.Seed

EF seed of algorithm definitions, revisions, and labels.

Lyo.PackageMetadata.Seed

EF seed of package metadata rows and stack prefixes.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.0.0 208 10/23/2026
2.0.1 113 9/14/2026
2.0.0 109 9/9/2026