26 lines
711 B
C#
26 lines
711 B
C#
using Indotalent.Data.Entities;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace Indotalent.Infrastructure.Database.Demo;
|
|
|
|
public static class BookingGroupSeeder
|
|
{
|
|
public static async Task GenerateDataAsync(AppDbContext context)
|
|
{
|
|
if (await context.BookingGroup.AnyAsync()) return;
|
|
|
|
var bookingGroups = new List<BookingGroup>
|
|
{
|
|
new BookingGroup { Name = "Vehicle" },
|
|
new BookingGroup { Name = "Room" },
|
|
new BookingGroup { Name = "Electronic" }
|
|
};
|
|
|
|
foreach (var bookingGroup in bookingGroups)
|
|
{
|
|
await context.BookingGroup.AddAsync(bookingGroup);
|
|
}
|
|
|
|
await context.SaveChangesAsync();
|
|
}
|
|
} |