Files
blazor-swm/Infrastructure/Database/Demo/ProductGroupSeeder.cs
T
2026-07-21 14:35:37 +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 = "Skincare & Facial Products" },
new ProductGroup { Name = "Body & Massage Oils" },
new ProductGroup { Name = "Essential Oils & Diffusers" },
new ProductGroup { Name = "Nutritional Supplements" },
new ProductGroup { Name = "Healthy Snacks & Beverages" },
new ProductGroup { Name = "Home Fitness Equipment" },
new ProductGroup { Name = "Yoga & Pilates Gear" },
new ProductGroup { Name = "Wellness Apparel & Footwear" },
new ProductGroup { Name = "Luxury Linens & Bathrobes" },
new ProductGroup { Name = "Personal Care & Hygiene" },
new ProductGroup { Name = "Professional Massage Services" },
new ProductGroup { Name = "Esthetic & Skin Treatments" },
new ProductGroup { Name = "Private Fitness Training" },
new ProductGroup { Name = "Group Exercise Programs" },
new ProductGroup { Name = "Yoga & Meditation Classes" },
new ProductGroup { Name = "Holistic Wellness Consulting" },
new ProductGroup { Name = "Hydrotherapy & Water Rituals" },
new ProductGroup { Name = "Rehabilitative Therapy Services" },
new ProductGroup { Name = "Body Contouring & Slimming" },
new ProductGroup { Name = "Exclusive Retreat Packages" }
};
foreach (var productGroup in productGroups)
{
await context.ProductGroup.AddAsync(productGroup);
}
await context.SaveChangesAsync();
}
}