From 3d7ab55b280a4137a3b8024106526c555d843302 Mon Sep 17 00:00:00 2001 From: Lennart Kampshoff Date: Sat, 22 Sep 2018 00:27:14 +0200 Subject: [PATCH] Added one load and one save to db, so that the EF doesnt need to initialize on first load / save --- Main.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Main.cs b/Main.cs index b28102a7..3f6166a1 100644 --- a/Main.cs +++ b/Main.cs @@ -1,5 +1,7 @@ using System; +using System.Linq; using GTANetworkAPI; +using reallife_gamemode.Model; /** * @overview Life of German Reallife - Main Class (Main.cs) @@ -20,6 +22,12 @@ namespace reallife_gamemode NAPI.Server.SetCommandErrorMessage("~r~[FEHLER]~s~ Dieser Command existiert nicht."); NAPI.Server.SetDefaultSpawnLocation(DEFAULT_SPAWN_POSITION, DEFAULT_SPAWN_HEADING); NAPI.Server.SetAutoSpawnOnConnect(false); + + using (var context = new DatabaseContext()) + { + context.Users.FirstOrDefault(); + context.SaveChanges(); + } } } } \ No newline at end of file