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

28 lines
957 B
C#

using Indotalent.Data.Entities;
using Microsoft.EntityFrameworkCore;
namespace Indotalent.Infrastructure.Database.Demo;
public static class EmployeeCategorySeeder
{
public static async Task GenerateDataAsync(AppDbContext context)
{
if (await context.EmployeeCategory.AnyAsync()) return;
var employeeCategories = new List<EmployeeCategory>
{
new EmployeeCategory { Name = "Medical & Clinical Professionals" },
new EmployeeCategory { Name = "Nursing & Clinical Support" },
new EmployeeCategory { Name = "Allied Health & Diagnostics" },
new EmployeeCategory { Name = "Administrative & Management" },
new EmployeeCategory { Name = "Operations & Facility Support" }
};
foreach (var category in employeeCategories)
{
await context.EmployeeCategory.AddAsync(category);
}
await context.SaveChangesAsync();
}
}