28 lines
809 B
C#
28 lines
809 B
C#
using Indotalent.Data.Entities;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace Indotalent.Infrastructure.Database.Demo;
|
|
|
|
public static class VendorGroupSeeder
|
|
{
|
|
public static async Task GenerateDataAsync(AppDbContext context)
|
|
{
|
|
if (await context.VendorGroup.AnyAsync()) return;
|
|
|
|
var vendorGroups = new List<VendorGroup>
|
|
{
|
|
new VendorGroup { Name = "Manufacture" },
|
|
new VendorGroup { Name = "Supplier" },
|
|
new VendorGroup { Name = "Service Provider" },
|
|
new VendorGroup { Name = "Distributor" },
|
|
new VendorGroup { Name = "Freelancer" }
|
|
};
|
|
|
|
foreach (var group in vendorGroups)
|
|
{
|
|
await context.VendorGroup.AddAsync(group);
|
|
}
|
|
|
|
await context.SaveChangesAsync();
|
|
}
|
|
} |