28 lines
959 B
C#
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();
|
|
}
|
|
} |