All checks were successful
continuous-integration/drone/pr Build is passing
* didn't work out so well, builds fine but refuses to run, stashing the idea for another time
25 lines
469 B
C#
25 lines
469 B
C#
using System;
|
|
using pwt_0x01_ng.Models.Database;
|
|
using System.Collections.Generic;
|
|
using pwt_0x01_ng.Models;
|
|
|
|
namespace pwt0x01ng.Models.Database
|
|
{
|
|
public static class DBInit
|
|
{
|
|
|
|
public static void Init(DBContext dbContext)
|
|
{
|
|
if (dbContext.Database.EnsureCreated())
|
|
{
|
|
IList<Carousel> carousels = CarouselHelper.GenerateCarousel();
|
|
foreach (var c in carousels)
|
|
{
|
|
dbContext.Carousel.Add(c);
|
|
}
|
|
dbContext.SaveChanges();
|
|
}
|
|
}
|
|
}
|
|
}
|