Demo Data

An optional set of sample categories and products, for trying the storefront out with real-looking content instead of an empty catalog. The screenshots throughout this documentation were all taken against this demo catalog.

Folder files

At the repository root, alongside eCommerceMVCCore/:

  • Database Scripts/demo-data-script.sql — the demo-data SQL script (categories, products, product pictures, specifications, etc.)
  • Database Scripts/Full_Database_Schema_Script.sql — an alternative SQL Server schema-creation script (generated from the EF Core migrations), for anyone who’d rather not let EF Core create the database automatically. Run it against an empty database, then start the app: it recognizes the migrations as applied and only seeds the initial data.

The demo product images already ship with the source under eCommerceMVCCore/eCommerce.Web/wwwroot/content/images/demo/ — there is no separate image folder to copy in.

Steps

  1. Make sure the database already exists and is migrated

    See Setup → Database Setup. This script only inserts rows — it doesn’t create the schema.

  2. Run the demo-data script

    sqlcmd -S "(localdb)\MSSQLLocalDB" -d ecommercedb_core -i "Database Scripts\demo-data-script.sql"

    Adjust the -S server name and -d database name to match your own connection string if you’re not using the default LocalDB setup.

  3. Reload the site

    The storefront and Dashboard will now show the demo catalog — categories, products with pictures and specifications, and a couple of sample orders/comments depending on which script you ran.

Run once, not repeatedly

This script inserts rows with fixed IDs into what’s assumed to be an otherwise-empty catalog. Run it on a fresh database, before adding any categories, products or pictures of your own — re-running it, or running it after you’ve added your own data, fails with duplicate-key errors.