liveBook · Manning

Data seeding

Data seeding is the process of populating a database with initial or required records.

How 2 Manning books explain it

Building Web APIs with ASP.NET Core

Database seeding is the process of populating a database with an initial, required, or imported set of records.

How it is used
Populates empty database tables so API retrieval and subsequent CRUD operations work with real records.
How deep it goes
Details file placement, mapping, parsing, validation, duplicate checks, persistence, and endpoint design, but not deployment automation.
Examples
Uses a board-game CSV import, SeedController endpoints, duplicate checks, skipped-row counts, and role initialization.
What you can do after
Build it from scratch by implementing an idempotent CSV import endpoint that maps records into EF Core entities.

Read how Building Web APIs with ASP.NET Core explains data seeding →

Pro ASP.NET Core 7, Tenth Edition

Seed data is initial data inserted into an application's database to establish required records and state.

How it is used
Populates new application and Identity databases with records needed for examples, testing, or administrator access.
How deep it goes
Works through migrations, service scopes, empty-set checks, inserts, startup calls, and explicit runs; contrasts built-in seeding with ordinary inserts.
Examples
Uses sample products, related suppliers and categories, calculation results, and an administrator account and role.
What you can do after
Build it from scratch with Entity Framework Core inserts and run it at startup or with INITDB=true.

Read how Pro ASP.NET Core 7, Tenth Edition explains data seeding →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.