Files
2026-07-21 13:52:43 +07:00

30 lines
992 B
C#

using Indotalent.Data.Entities;
using Microsoft.EntityFrameworkCore;
namespace Indotalent.Infrastructure.Database.Demo;
public static class SalesOrderGroupSeeder
{
public static async Task GenerateDataAsync(AppDbContext context)
{
if (await context.SalesOrderGroup.AnyAsync()) return;
var salesOrderGroups = new List<SalesOrderGroup>
{
new SalesOrderGroup { Name = "Inpatient" },
new SalesOrderGroup { Name = "Outpatient" },
new SalesOrderGroup { Name = "Emergency Care" },
new SalesOrderGroup { Name = "Telemedicine" },
new SalesOrderGroup { Name = "Medical Check-Up" },
new SalesOrderGroup { Name = "Home Care Services" },
new SalesOrderGroup { Name = "Day Care / Day Surgery" }
};
foreach (var group in salesOrderGroups)
{
await context.SalesOrderGroup.AddAsync(group);
}
await context.SaveChangesAsync();
}
}