diff options
author | Luca Matei Pintilie <luca@lucamatei.com> | 2024-10-30 20:59:53 +0000 |
---|---|---|
committer | Luca Matei Pintilie <luca@lucamatei.com> | 2024-10-30 20:59:53 +0000 |
commit | dc1938dbb98dc9edf16558e505b2961246c83e6e (patch) | |
tree | 7953186976085ceca6c03a208d1ffd9596f745be /Api/Utils/DbInit.cs | |
parent | fc3c7e3b3c955cc274d4668768466fecb8fb727b (diff) | |
download | wikiwaka-dc1938dbb98dc9edf16558e505b2961246c83e6e.tar wikiwaka-dc1938dbb98dc9edf16558e505b2961246c83e6e.tar.gz wikiwaka-dc1938dbb98dc9edf16558e505b2961246c83e6e.tar.bz2 wikiwaka-dc1938dbb98dc9edf16558e505b2961246c83e6e.tar.lz wikiwaka-dc1938dbb98dc9edf16558e505b2961246c83e6e.tar.xz wikiwaka-dc1938dbb98dc9edf16558e505b2961246c83e6e.tar.zst wikiwaka-dc1938dbb98dc9edf16558e505b2961246c83e6e.zip |
Diffstat (limited to '')
-rw-r--r-- | Api/Utils/DbInit.cs | 25 |
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(); + } +} |