25 lines
699 B
C#
25 lines
699 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 = "Front of House" },
|
|
new EmployeeCategory { Name = "Back of House" }
|
|
};
|
|
|
|
foreach (var category in employeeCategories)
|
|
{
|
|
await context.EmployeeCategory.AddAsync(category);
|
|
}
|
|
|
|
await context.SaveChangesAsync();
|
|
}
|
|
} |