This repository has been archived on 2023-10-28. You can view files and clone it, but cannot push or open issues or pull requests.
pwt-0x01-ng/Models/Database/DBInit.cs
surtur 83379ec335
All checks were successful
continuous-integration/drone/pr Build is passing
chore: revert 61714e3d9e
* didn't work out so well, builds fine but refuses to run, stashing
  the idea for another time
2020-12-26 18:42:34 +01:00

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();
}
}
}
}