Files
blazor-cms/Infrastructure/Database/Demo/ProductGroupSeeder.cs
T
2026-07-21 13:52:43 +07:00

43 lines
1.9 KiB
C#

using Indotalent.Data.Entities;
using Microsoft.EntityFrameworkCore;
namespace Indotalent.Infrastructure.Database.Demo;
public static class ProductGroupSeeder
{
public static async Task GenerateDataAsync(AppDbContext context)
{
if (await context.ProductGroup.AnyAsync()) return;
var productGroups = new List<ProductGroup>
{
new ProductGroup { Name = "Prescription Medications" },
new ProductGroup { Name = "Over-the-Counter (OTC) Drugs" },
new ProductGroup { Name = "Vaccines & Immunizations" },
new ProductGroup { Name = "Medical & Surgical Supplies" },
new ProductGroup { Name = "Diagnostic Instruments" },
new ProductGroup { Name = "Laboratory Reagents" },
new ProductGroup { Name = "Personal Protective Equipment (PPE)" },
new ProductGroup { Name = "Wound Care & Dressings" },
new ProductGroup { Name = "Dental Supplies" },
new ProductGroup { Name = "IV Fluids & Solutions" },
new ProductGroup { Name = "General Consultations" },
new ProductGroup { Name = "Specialist Consultations" },
new ProductGroup { Name = "Laboratory Tests & Profiles" },
new ProductGroup { Name = "Radiology & Imaging" },
new ProductGroup { Name = "Minor Surgical Procedures" },
new ProductGroup { Name = "Dental Procedures" },
new ProductGroup { Name = "Physical Therapy & Rehab" },
new ProductGroup { Name = "Emergency Care Services" },
new ProductGroup { Name = "Maternal & Child Health" },
new ProductGroup { Name = "Medical Checkup Packages" }
};
foreach (var productGroup in productGroups)
{
await context.ProductGroup.AddAsync(productGroup);
}
await context.SaveChangesAsync();
}
}