Files
blazor-crm/Infrastructure/Database/Demo/ProgramManagerResourceSeeder.cs
2026-07-21 13:59:38 +07:00

28 lines
959 B
C#

using Indotalent.Data.Entities;
using Microsoft.EntityFrameworkCore;
namespace Indotalent.Infrastructure.Database.Demo;
public static class ProgramManagerResourceSeeder
{
public static async Task GenerateDataAsync(AppDbContext context)
{
if (await context.ProgramManagerResource.AnyAsync()) return;
var programResources = new List<ProgramManagerResource>
{
new ProgramManagerResource { Name = "Information Technology" },
new ProgramManagerResource { Name = "Human Resource" },
new ProgramManagerResource { Name = "Operations" },
new ProgramManagerResource { Name = "Sales Marketing" },
new ProgramManagerResource { Name = "Finance Accounting" }
};
foreach (var programResource in programResources)
{
await context.ProgramManagerResource.AddAsync(programResource);
}
await context.SaveChangesAsync();
}
}