Table of Contents

Interface IDatabaseSeeder

Namespace
SEBT.Portal.Core.Services
Assembly
SEBT.Portal.Core.dll

Service for seeding the database with initial or test data.

public interface IDatabaseSeeder

Methods

ClearSeededDataAsync(CancellationToken)

Clears all seeded data from the database. WARNING: This will delete all users and opt-ins. Use with caution.

Task ClearSeededDataAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

A token to cancel the operation.

Returns

Task

ReseedUserScenarioAsync(string, bool, CancellationToken)

Deletes and recreates a single known seed scenario user so mutable E2E suites can restore a clean starting state without clearing the whole seed set.

Task ReseedUserScenarioAsync(string scenarioName, bool useMockHouseholdData, CancellationToken cancellationToken = default)

Parameters

scenarioName string

A name from SeedScenarios.

useMockHouseholdData bool

Whether to reseed via the mock-household path.

cancellationToken CancellationToken

A token to cancel the operation.

Returns

Task

SeedTestUsersAsync(bool, CancellationToken)

Seeds the database with specific test users for development.

Task SeedTestUsersAsync(bool useMockHouseholdData, CancellationToken cancellationToken = default)

Parameters

useMockHouseholdData bool

Whether to seed users corresponding to household mock data.

cancellationToken CancellationToken

A token to cancel the operation.

Returns

Task

SeedTestUsersAsync(CancellationToken)

Seeds the database with specific test users for development.

Task SeedTestUsersAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

A token to cancel the operation.

Returns

Task

SeedUsersAsync(int, CancellationToken)

Seeds the database with sample users for development/testing.

Task SeedUsersAsync(int userCount = 10, CancellationToken cancellationToken = default)

Parameters

userCount int

Number of users to create (default: 10).

cancellationToken CancellationToken

A token to cancel the operation.

Returns

Task