Beispiel #1
0
        public void Initialize()
        {
            _context = ITAlertLoggingContextFactory.Create();

            CreateGame();
            CreatePlayers();

            _subscription = _eventSystem.Subscribe(EnqueueEvent);
            StartQueueWorker();
        }
        public static ITAlertLoggingContext Create()
        {
            var connectionStrings = System.Configuration.ConfigurationManager.ConnectionStrings;
            var connectionString  = connectionStrings["DatabaseEventLoggerContext"].ConnectionString;

            DbConfiguration.SetConfiguration(new MySqlEFConfiguration());

            var connection = new MySqlConnection(connectionString);
            var context    = new ITAlertLoggingContext(connection, true);

            context.Database.CreateIfNotExists();

            return(context);
        }