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