29 lines
876 B
C#
29 lines
876 B
C#
using Indotalent.Data.Entities;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace Indotalent.Infrastructure.Database.Demo;
|
|
|
|
public static class VendorCategorySeeder
|
|
{
|
|
public static async Task GenerateDataAsync(AppDbContext context)
|
|
{
|
|
if (await context.VendorCategory.AnyAsync()) return;
|
|
|
|
var vendorCategories = new List<VendorCategory>
|
|
{
|
|
new VendorCategory { Name = "Large" },
|
|
new VendorCategory { Name = "Medium" },
|
|
new VendorCategory { Name = "Small" },
|
|
new VendorCategory { Name = "Specialty" },
|
|
new VendorCategory { Name = "Local" },
|
|
new VendorCategory { Name = "Global" }
|
|
};
|
|
|
|
foreach (var category in vendorCategories)
|
|
{
|
|
await context.VendorCategory.AddAsync(category);
|
|
}
|
|
|
|
await context.SaveChangesAsync();
|
|
}
|
|
} |