예제 #1
0
        /// <summary>
        /// Initializes the database or creates a new one if it does not exists already.
        /// </summary>
        internal bool Load()
        {
            try
            {
                using (AuraContext database = new AuraContext())
                {
                    bool cine = database.Database.CreateIfNotExists();

                    if (cine)
                    {
                        ServerLogger.Database("Creating database...");
                    }
                    else
                    {
                        ServerLogger.Database("Preparing database...");
                    }

                    return(true);
                }
            }
            catch (Exception)
            {
                ServerLogger.Error("Failed to load the database!");
                return(false);
            }
        }