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

33 lines
1.3 KiB
C#

using Indotalent.Data.Entities;
using Microsoft.EntityFrameworkCore;
namespace Indotalent.Infrastructure.Database.Demo;
public static class BookingGroupSeeder
{
public static async Task GenerateDataAsync(AppDbContext context)
{
if (await context.BookingGroup.AnyAsync()) return;
var bookingGroups = new List<BookingGroup>
{
new BookingGroup { Name = "General Practice Consultations" },
new BookingGroup { Name = "Specialist Consultations" },
new BookingGroup { Name = "Dental Care & Procedures" },
new BookingGroup { Name = "Laboratory & Blood Testing" },
new BookingGroup { Name = "Radiology & Diagnostic Imaging" },
new BookingGroup { Name = "Physical Therapy & Rehabilitation" },
new BookingGroup { Name = "Maternal & Women's Health" },
new BookingGroup { Name = "Pediatric Care & Immunizations" },
new BookingGroup { Name = "Minor Surgical Procedures" },
new BookingGroup { Name = "Health Screening & Medical Checkups" }
};
foreach (var bookingGroup in bookingGroups)
{
await context.BookingGroup.AddAsync(bookingGroup);
}
await context.SaveChangesAsync();
}
}