summaryrefslogblamecommitdiff
path: root/Api/Utils/DbInit.cs
blob: 0fc2d862117df3135104494bc208a50216163068 (plain) (tree)
























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