initial commit
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user