initial commit
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
using Indotalent.Data.Entities;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Indotalent.Infrastructure.Database.Demo;
|
||||
|
||||
public static class WarehouseSeeder
|
||||
{
|
||||
public static async Task GenerateDataAsync(AppDbContext context)
|
||||
{
|
||||
if (await context.Warehouse.Where(x => x.SystemWarehouse == false).AnyAsync()) return;
|
||||
|
||||
var warehouses = new List<Warehouse>
|
||||
{
|
||||
new Warehouse { Name = "Main Pharmacy" },
|
||||
new Warehouse { Name = "Central Supply Room" },
|
||||
new Warehouse { Name = "Laboratory" },
|
||||
new Warehouse { Name = "Emergency Room Storage" },
|
||||
new Warehouse { Name = "General Practice Room" },
|
||||
new Warehouse { Name = "Dental Clinic Storage" },
|
||||
new Warehouse { Name = "Radiology Department" },
|
||||
new Warehouse { Name = "Pediatrics Ward" },
|
||||
new Warehouse { Name = "Surgical Suite Storage" },
|
||||
new Warehouse { Name = "Maternity Ward" }
|
||||
};
|
||||
|
||||
foreach (var warehouse in warehouses)
|
||||
{
|
||||
await context.Warehouse.AddAsync(warehouse);
|
||||
}
|
||||
|
||||
await context.SaveChangesAsync();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user