Add database seeder with sample data and test guide
This commit is contained in:
@@ -22,6 +22,14 @@ builder.Services.AddScoped<ITransactionService, TransactionService>();
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
// Seed database with sample data
|
||||
using (var scope = app.Services.CreateScope())
|
||||
{
|
||||
var context = scope.ServiceProvider.GetRequiredService<HospitalityDbContext>();
|
||||
await Hospitality.Backend.Data.DbSeeder.SeedAsync(context);
|
||||
}
|
||||
|
||||
|
||||
// Configure the HTTP request pipeline.
|
||||
if (app.Environment.IsDevelopment())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user