summaryrefslogtreecommitdiff
path: root/Api/Utils/DbInit.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Api/Utils/DbInit.cs')
-rw-r--r--Api/Utils/DbInit.cs25
1 files changed, 25 insertions, 0 deletions
diff --git a/Api/Utils/DbInit.cs b/Api/Utils/DbInit.cs
new file mode 100644
index 0000000..0fc2d86
--- /dev/null
+++ b/Api/Utils/DbInit.cs
@@ -0,0 +1,25 @@
+using WikiWaka.Api.Models;
+
+public static class DbInit
+{
+ private static readonly Language[] languages = [
+ new() {
+ Id = 1,
+ LanguageCode = "nb-NO",
+ },
+ new() {
+ Id = 2,
+ LanguageCode = "nn-NO",
+ },
+ new() {
+ Id = 3,
+ LanguageCode = "en-US",
+ },
+ ];
+
+ public static async Task InitializeLanguages(DbWikiWakaContext db)
+ {
+ await db.Language.AddRangeAsync(languages);
+ _ = await db.SaveChangesAsync();
+ }
+}